Forum Moderators: open

Message Too Old, No Replies

ASPmail help needed please

Need to adapt a script from CDonts to ASPmail

         

aussie

6:02 am on Mar 17, 2003 (gmt 0)

10+ Year Member




Was wondering if anyone could help me change some code. I am a complete newbie to code.

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

wardbekker

7:24 am on Mar 17, 2003 (gmt 0)

10+ Year Member



aussie,

This may be a good time to do some coding yourself ;-) A good starting point is to compare the functions of CDONTS with ASPmail.

Have fun!

aussie

7:29 pm on Mar 20, 2003 (gmt 0)

10+ Year Member



Warbbekker,

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

%>
*********************

duckhunter

4:29 am on Mar 21, 2003 (gmt 0)

10+ Year Member



Here's the ASPMail Option:

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