AddHeader Method
Adds custom header to the message.
If you want to add header different from "To", "CC", "From",
"Subject", "Date", "Message-ID", "Content-Type",
"Content-Transfer-Encoding", "MIME-Version", "X-Mailer",
"Return-Path", "Reply-To", use this method.
If specified header is already in the message, it will be overwritten.
blnResult = ObjectName.AddHeader(Name,
Value) |
Parameters: | ||
Name As String | Custom header name (like "X-Priority", "Organization", etc.) | |
Value As String | Custom header value | |
Return value As Boolean | True if successful. False if header name is empty or predefined (such as "From", "Date", etc.) |
Usage example:
Dim Mailer 'Using visual basic to create object Set Mailer = CreateObject("MailBee.SMTP") 'Using ASP to create object 'Set Mailer = Server.CreateObject("MailBee.SMTP") 'In ASP use Response.Write instead of MsgBox Mailer.LicenseKey = "put your license key here" Mailer.ServerName = "mail.server.com" If Mailer.Connect Then Mailer.Message.ToAddr = "bill@yoursite.com" Mailer.Message.FromAddr = "joe@mysite.com" Mailer.Message.Subject = "Hello" Mailer.Message.AddHeader "Organization", "AfterLogic Corp" Mailer.Message.ImportBodyText "C:\docs\letter.htm", True Mailer.Send Mailer.Disconnect End If
See Also:
Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.