Forum Moderators: open
Basically my host doesn't support CDONTS and the script I purchased requires it for a mailing function. The script is great otherwise! My other scripts use ASPmail and wanted to adapt this one to use ASPmail also.
The code checks some paramaters and attaches a file from the nominated directory and emails to the end user. Have copied it below.
All help is appreciated.
**************
Dim objEmail
Set objEmail = Server.CreateObject("CDONTS.NewMail")
IF (Email_Format = "html") THEN
objEmail.BodyFormat = 0
END IF
objEmail.MailFormat = 0
objEmail.From = (Paypal_Email)
objEmail.To = (Payer_Email)
objEmail.Subject = (Subject_Line)
IF (Send_Digital = "on") THEN
objEmail.AttachFile(Digital_Item)
END IF
objEmail.Body = (EMAIL_Body)
objEmail.Send
Set objEmail = Nothing
Message.Close
Set Message = Nothing
Set Body = Nothing
END IF
*************************
Any help would be much appreciated. Thanks
I have been advised that I need to have the script operate using Jmail. Learn something everyday ;-)
My crude attempt is below. It omits a few of the checks of the original but I have even less idea about how to make those happen than I do about what has happenned below.
Any suggetsions?
*****************************
<%
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ServerAddress = "mail.myserver.com"
JMail.Sender = ("Paypal_Email")
JMail.Subject = ("Subject_Line")
JMail.AddRecipient = ("Payer_Email")
JMail.AppendBodyFromFile ("Email_body)"
JMail.Priority = 1
JMail.AddAttachment ("Digital_Item")
JMail.Execute
%>
*********************
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "YourCompany Name"
Mailer.FromAddress= Paypal_Email
Mailer.RemoteHost = "your.mailserver.com"
Mailer.AddRecipient Payer_Email, Payer_Email 'address/name
Mailer.Subject = Subject_Line
Mailer.ContentType = "text/html"
Mailer.BodyText = EMAIL_Body
Mailer.AddCC = "someotherrecipient@somedomain.com"
Mailer.AddBcc = "someotherrecipient@somedomain.com"
objMail.AddAttachment = Digital_Item
If Mailer.SendMail then
' Success
else
'Failed
end if
Set Mailer = nothing