SendMail
The SendMail method attempts to send an electronic mail message.
Syntax
SendMail(mailserver, recipient, sender, subject, message_text)
Parameters
-
mailserver
-
Specifies the name of SMTP mail server.
-
recipient
-
The email address of the person who will receive the electronic
mail message. Multiple recipients separated by a comma only.
You may need to surround the recipient name with angle brackets.
-
sender
-
The email address of the person sending the email message.
-
subject
-
The subject of the message.
-
message_text
-
The text of the message.
Return Values
Returns an empty string if the message was sent successfully.
Otherwise returns a string indicating the error that occurred.
Notes
If you are sending a long message and you want to format the
lines, use VbCrLf (Chr(13)+Chr(10) ) to insert
end-of-lines. Eg
message = "Thanks, " & vbCrLf & vbCrLf & "it works a treat!"
Example
The following sends an email
<% Set Mailer = Server.CreateObject("ASPMail.ASPMailCtrl.1") %>
<%
recipient = "Joe@mailer.net"
sender = "Cheryl@mailer.net"
subject = "Great Program"
message = "Thanks man, " & vbCrLf & vbCrLf & "it works a treat!"
mailserver = "mailer.flicks.com"
result = Mailer.SendMail(mailserver, recipient, sender, subject, message)
%>
<% If "" = result Then %>
<P>
Mail has been sent.
<P>
<% Else %>
<P>
Mail was not sent, error message is
<H2>
<%= result %>
</H2>
<P>
<% End If %>
Applies To
OCXMail ASP Component
http://www.flicks.com/authentix/discover/main.htm