Flicks FAQ: Xheader

Back to the top of the FAQ


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.


XHeader(header, value)


Specifies the X-header to be added or overridden.
The value associated witht the X-Header.

Return Values

Returns nothing.


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 %>
Mail has been sent.
<% Else %>
Mail was not sent, error message is
<%= result %>
<% End If %>


Applies To

OCXMail ASP Component


Back to the top of the FAQ