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

The following sends an email


<% Set mailer = Server.CreateObject("ocxQmail.ocxQmailCtrl.1") 
<%

mailServer = "mailer.mailer.net"
fromName = "System Administrator"
fromAddress = "admin@mailer.net"
priority = ""
returnReceipt = ""

toAddressList = "customer197@mailer.net"

ccAddressList = "sales@mailer.net"

bccAddressList = "admin@mailer.net"
bccAddressList = bccAddressList & ","
bccAddressList = bccAddressList & "loggingAccount@mailer.net"

attachmentList = ""
messageSubject = "Welcome on board!"
messageText = "Welcome to mailer.net"
messageText = messageText & Chr(10)
messageText = messageText & "We hope you enjoy our services."
messageText = messageText & Chr(10)

'cTypeString = "text/html; charset=""iso-8859-1"""
cTypeString = "text/plain; charset=""iso-8859-1"""
result = Mailer.XHeader("Content-Type", cTypeString)
result = Mailer.XHeader("Date", "Mon, 31 Dec 1999 23:59:59 -0700")
result = Mailer.XHeader("X-Sender", "sjoyce@mail")


result = mailer.Q( mailServer,      _ 
               fromName,      _ 
               fromAddress,      _ 
               priority,      _ 
               returnReceipt,      _ 
               toAddressList,      _ 
               ccAddressList,      _ 
               bccAddressList,      _ 
               attachmentList,      _ 
               messageSubject,      _ 
               messageText      _ 
               ) 
%>
<% If  "" = result Then %>
<P>
Mail has been queued.
<P>
<% Else %>
<P>
Mail was not queued, error message is
<H2>
<%= result %>
</H2>
<P>
<% End If %>


 

Applies To

ocxQmail ASP Component