Using the component is as simple as:
| FromName | The
name that should be used for the Sender of the message. Example: Mailer.FromName = "Joe's Widgets Corp." |
| FromAddress | The
email address that should be used as the sender of the message. Example: Mailer.FromAddress = "sales@joeswidgets.com" |
| Subject | This
will be used as the Subject of the message. Example: Mailer.Subject = "Your Widget Order" |
| BodyText | This
will be the actual message. Example: Mailer.BodyText = "Your order was processed." |
| RemoteHost |
The SMTP server to be used for
sending the message. You will want to change this to reflect the mail
server that you use on your group (www13). |
| AddRecipient name, email addr | This
method adds a name and email address to the "To:" field of the
message. Example: Mailer.AddRecipient "John Smith", "jsmith@someisp.com" |
Completed
Example
<%
Set Mailer = Server.CreateObject ("SMTPsvg.Mailer")
Mailer.FromName = "Joe's Widgets Corp."
Mailer.FromAddress = "sales@joeswidgets.com"
Mailer.Subject = "Your Widget Order"
Mailer.BodyText = "Your order was processed."
Mailer.RemoteHost = "outbound-relay.biz.rr.com"
Mailer.AddRecipient "John Smith", "jsmith@someisp.com"
if Mailer.SendMail then
' Message sent sucessfully
response.write ("Your message
was sent")
else
' Message send failure
response.write ("Your message
was not sent. ")
response.write ("The error was:
" & Mailer.Response)
end if
%>
Note: To CC or
BCC additional recipients, add the following code (with the proper recipient
names and e-mail addresses) after "Mailer.AddRecipient":
Mailer.AddCC "Jane Smith", janesmith@someisp.com
Mailer.AddBCC "Joe Smith", joesmith@someisp.com