1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
<%
Function SendMail(FromName, FromAddress, RecipientName, RecipientEmail, Subject, BodyText, CCName, CCAddress)
BodyText="<html><head><meta http-equiv=""content-type"" content=""text/html; charset=iso-8859-1""></head>"&BodyText&"</html>"
if FromName="" then FromName="XXXXX"
if FromAddress="" then FromAddress="xxxx@xxx.com"
set MailerObject=Server.CreateObject("Persits.MailSender")
MailerObject.IsHTML = True
MailerObject.CharSet = "iso-8859-1"
MailerObject.ContentTransferEncoding = "Quoted-Printable"
MailerObject.FromName=FromName&" <"&FromAddress&">"
MailerObject.From=FromAddress
MailerObject.AddReplyTo FromAddress
MailerObject.Host="smtp.xxx.com"
if RecipientEmail<>Replace(RecipientEmail,";"," ") then
RecipientEmailArray=Split(RecipientEmail,";")
for each RecipientEmailElement in RecipientEmailArray
if RecipientEmailElement<>"" then
MailerObject.AddAddress RecipientEmailElement, RecipientEmailElement
end if
next
else
MailerObject.AddAddress RecipientEmail, RecipientEmail 'RecipientName !!!
end if
if CCAddress<>"" then
if CCAddress<>Replace(CCAddress,";"," ") then
CCAddressArray=Split(CCAddress,";")
for each CCAddressElement in CCAddressArray
if CCAddressElement<>"" then
MailerObject.AddBcc CCAddressElement, CCAddressElement
end if
next
else
MailerObject.AddBcc CCAddress, CCAddress 'CCName !!!
end if
end if
MailerObject.Subject=Subject
MailerObject.Body=BodyText
MailerObject.UserName = "xxxx"
MailerObject.Password = "xxxxx"
if MailerObject.Send then
SendMail=true
else
SendMail=false
end if
set MailerObject=nothing
End Function
%> |
Partager