Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/08/2004, 10:37
JosephFley
 
Fecha de Ingreso: marzo-2004
Ubicación: San José, Costa Rica
Mensajes: 234
Antigüedad: 21 años, 1 mes
Puntos: 0
Bueno este es un ejemplo completo y funcional(real...)....

'-------------------------------------------------------------------------------------
Function Envio_Info

Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.com"
Mail.From = Request.Form("Email")
Mail.IsHTML = True
Mail.FromName = Request.Form("First_name") & " " & Request.Form("Last_name")


Mail.AddAddress "[email protected]","The Alta Hotel Web Reservation"
Mail.Subject = "Reservation Request"


Body = "----------------- THE ALTA HOTEL WEB RESERVATION --------------<br><br><br>"

Body = Body & "----------------- Personal Information --------------<br>"
Body = Body & "<strong>Title: </strong>" & Request.Form("Title") & "<br>"
Body = Body & "<strong>First Name: </strong>" & Request.Form("First_Name") & "<br>"
Body = Body & "<strong>Last Name: </strong>" & Request.Form("Last_Name") & "<br>"
Body = Body & "<strong>Phone: </strong>" & Request.Form("Phone") & "<br>"
Body = Body & "<strong>Fax: </strong>" & Request.Form("Fax") & "<br>"
Body = Body & "<strong>E-Mail: </strong>" & Request.Form("Email") & "<br><br>" & chr(13) & chr(10)

Body = Body & "----------------- Arrival Information --------------<br>"
Body = Body & "<strong>Arrival Date: </strong>" & Request.Form("Arrival_Day") & " - " & Request.Form("Arrival_Month") & " - " & Request.Form("Arrival_Year") & "<br>"
Body = Body & "<strong>Arrival Time: </strong>" & Request.Form("Arrival_Time") & "<br>"
Body = Body & "<strong>Airline and Flight Number: </strong>" & Request.Form("Arrival_Airline") & "<br><br>" & chr(13) & chr(10)

Body = Body & "----------------- Departure Information --------------<br>"
Body = Body & "<strong>Departure Date: </strong>" & Request.Form("Departure_Day") & " - " & Request.Form("Departure_Month") & " - " & Request.Form("Departure_Year") & "<br>"
Body = Body & "<strong>Departure Time: </strong>" & Request.Form("Departure_Time") & "<br>"
Body = Body & "<strong>Airline and Flight Number: </strong>" & Request.Form("Departure_Airline") & "<br><br>" & chr(13) & chr(10)

Body = Body & "------------------ Reservation Details ---------------<br>"
Body = Body & "<strong>Type of Room: </strong>" & Request.Form("Type_of_Room") & "<br>"
Body = Body & "<strong>Bed Type: </strong>" & Request.Form("Bed_Type") & "<br>"
Body = Body & "<strong>Number of Rooms: </strong>" & Request.Form("Number_of_Rooms") & "<br>"
Body = Body & "<strong>Number of Adults: </strong>" & Request.Form("Number_of_Adults") & "<br>"
Body = Body & "<strong>Number of Children: </strong>" & Request.Form("Number_of_Children") & "<br><br>" & chr(13) & chr(10)

Body = Body & "----------------- Credit Card Information --------------<br>"
Body = Body & "<strong>Credit Card Type: </strong>" & Request.Form("Credit_Card_Type") & "<br>"
Body = Body & "<strong>Credit Card Number: </strong>" & Request.Form("Credit_Card_Number") & "<br>"
Body = Body & "<strong>Expiration Date: </strong>" & Request.Form("Expiration_Date") & "<br><br>" & chr(13) & chr(10)

IF NOT (Request.Form("Party") = "") Then

Body = Body & "----------------- Restaurante La Luz Reservation --------------<br>"
Body = Body & "<strong>Date: </strong>" & Request.Form("Restaurant_Day") & " - " & Request.Form("Restaurant_Month") & " - " & Request.Form("Restaurant_Year") & "<br>"
Body = Body & "<strong>Time: </strong>" & Request.Form("Restaurant_Time") & "<br>"
Body = Body & "<strong>Party of: </strong>" & Request.Form("Party") & "<br>"
Body = Body & "<strong>Smoking Preference: </strong>" & Request.Form("Smoking") & "<br><br>" & chr(13) & chr(10)

END IF

Body = Body & "------ I want to receive additional informationa about --------<br>"
Body = Body & "<strong>Tours available from the Hotel: </strong>" & Request.Form("Information_Tours") & "<br>"
Body = Body & "<strong>Car Rental: </strong>" & Request.Form("Information_Cars") & "<br>"
Body = Body & "<strong>Ground Transfers: </strong>" & Request.Form("Information_Transfers") & "<br><br><br>" & chr(13) & chr(10)

Body = Body & "----------------- THE ALTA HOTEL WEB RESERVATION --------------<br>"

Mail.Body = Body


On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write "Error encountered: " & Err.Description & "<br>"
End If

SET Mail = Nothing

End Function

------------------------------------

El punto es que crees el body primero ya que así lo puedes hacer tan dinámico como quieras y despues lo pasas al objeto...