|
Back to the top of the FAQ
XHeader
The XHeader method adds any X-Header or overrides the Date or Content-Type.
Call as many times as you want before you call
a method that sends mail.
With this method you can
change the character set to
ISO-8859-1, change the message's date, or change the Content-Type, among
many others.
NB It is best not to change the Content-Type if you are sending an attachment.
Syntax
XHeader(header, value)
Parameters
-
header
-
Specifies the X-header to be added or overridden.
-
value
-
The value associated witht the X-Header.
Return Values
Returns nothing.
Example
To change the time:
Mailer.XHeader "Date", FormatDateTime(Date, 1) & " " & FormatDateTime(Time, 4) & " CDT"
The following sends an email
<% Set Mailer = Server.CreateObject("ASPMail.ASPMailCtrl.1") %>
<%
recipient = "Joe@Mailer.net"
sender = "Cheryl@Mailer.net"
subject = "Great Program"
crlf = chr(10) & chr(13)
message = "<H2><font color=blue>The Message Contents</font></h2><P>" & crlf
mailserver = "Mailer.flicks.com"
result = Mailer.XHeader("Date", "Mon, 31 Dec 1999 23:59:59 -0700")
'cTypeString = "text/plain; charset=""iso-8859-1"""
cTypeString = "text/html; charset=""iso-8859-1"""
result = Mailer.XHeader("Content-Type", cTypeString)
result = Mailer.XHeader("X-Sender", "sjoyce@mail")
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
Back to the top of the FAQ
|
|