Flicks FAQ: Smtpsendmail


Back to the top of the FAQ

SMTPSendMail

The SMTPSendMail method sends an SMTP mail message. This method, while not strictly related to Authentication per se, is nonetheless convenient.
For more sophisticated email functions (attachments, Bcc's etc) see OCXMail and ocxQmail available separately.

Syntax

SMTPSendMail(mailServer, recipient, sender, subject, message_text)

Parameters

mailServer
Specifies the smtp mail server.
recipient
Specifies the recipient of the message.
sender
Specifies the sender of the message.
subject
Specifies the subject of the message.
message_text
Specifies 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.

Example

The following example sends a message

<% 
usingAuthentiXStandard = true
if (usingAuthentiXStandard) then
Set AuthX = Server.CreateObject("AUTHXOCX.AuthXOCXCtrl.1") 
else
Set AuthX = Server.CreateObject("AUTHXISP.AuthXOCXCtrl.1") 
protectedDomain = Request.ServerVariables("LOCAL_ADDR")
'protectedDomain = "hostheader.com"
AuthX.SetVirtualDomain protectedDomain, Request.ServerVariables("SCRIPT_NAME")
AuthX.SetVirtualDomainPassword("")
end if
%>
<% 
subject = "Message Subject"
message_text = "This is this contents of the message"
"localhost"result = AuthX.SMTPSendMail("ntmail.flicks.com", "alex@alex.com", "richard@flicks.com", subject, message_text)
%>
<% If  "" = result Then %>
Mail has been sent.
<% Else %>
Mail was not sent, error message is
<H2>
<%= result %>
</H2>
<% End If %>

 

Applies To

AuthentiX OCX Component

http://www.flicks.com/authentix/discover/main.htm

Back to the top of the FAQ