Print Page | Close Window

Change CDONTS to W3 JMail

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=16573
Printed Date: 29 March 2026 at 5:15pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Change CDONTS to W3 JMail
Posted By: kwouters
Subject: Change CDONTS to W3 JMail
Date Posted: 16 September 2005 at 5:58am
Hi There,
 
I download a script ( http://www.iloire.com/vbscript/online_photo_catalog_vbscript.asp - http://www.iloire.com/vbscript/online_photo_catalog_vbscript.asp ) and installed it. It works great for me, except for one thing.
It should mail comments to me, but it does that using CDONTS. I don't have that installed on my server. I do have W3 Jmail, so I thought about rewriting the mail procedure.
 
Original script:
'lets send an email using CDONTS (be sure you have installed it in your server)
 Dim objCDO
 Set objCDO = Server.CreateObject("CDONTS.NewMail")
 objCDO.To = cAdminEmail
 objCDO.From = cAdminEmail
 objCDO.Subject = "Simple online photo catalogue comment"
 objCDO.Body = "Author: " & author & vbcrlf & _
 "Email: " & email & vbcrlf &  _
 "Comments: " & text & vbcrlf & _
 "Picture: " & vbcrlf & picturelink & _
 vbcrlf & "--" & vbcrlf & cPageTitle
 objCDO.Send
 Set objCDO = Nothing
 
Rewritten W3 Jmail script:
'lets send an email using w3Jmail (be sure you have installed it in your server)
 Dim objJMail
 Set objJMail = Server.CreateObject("JMail.SMTPMail")
 objJMail.ServerAdress = "smtp.onderwijs.casematelecom.nl:25"
 objJMail.Sender= cAdminEmail
 objJMail.SenderName = "Leko's Wereld Fotoalbum"
 objJMail.AddRecipient cAdminEmail
 objJMail.Subject = "Opmerking bij foto..."
 objJMail.Body = "Van: " & author & vbcrlf & _
 "E-mail: " & email & vbcrlf &  _
 "Opmerking: " & text & vbcrlf & _
 "Foto: " & vbcrlf & picturelink & _
 vbcrlf & "--" & vbcrlf & cPageTitle
 objJMail.Priority = 3
 objJMail.Execute
 Set objJMail = Nothing
 
Unfortunately it doesn't work. Other scripts (like the journal from this site) work fine. Does anyone know what the problem is?
Any help would be appriciated.
 
Greetings,
 
Koen



Replies:
Posted By: dpyers
Date Posted: 16 September 2005 at 4:29pm
"Doesn't work" doesn't give much to go on. What or how?

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: kwouters
Date Posted: 19 September 2005 at 7:54am
Well the doesn't work stand for 'not sending an e-mail'.
I don't get any errormessage. But I don't get any mail as well.
As said other scripts using w3 Jmail work fine.
So my question mostly is: Is the code to send e-mail correct?
If so it must be some other problem.
Could I easily make a routine to output its result?
Something like response.write(succesfull) or responsewrite(unsuccesfull)? And what would that look like? I have no asp-experience.


Posted By: kwouters
Date Posted: 19 September 2005 at 8:30am
Found the problem... I used the asp tutorial on this site, but it seems something have changed... e.g. Sender now is From, etc.
The correct script turned out to be:
'lets send an email using w3Jmail (be sure you have installed it in your server)
 Dim objJMail
 Set objJMail = Server.CreateObject("JMail.Message")
 objJMail.From= cAdminEmail
 objJMail.FromName = "Your albumname"
 objJMail.AddRecipient cAdminEmail
 objJMail.Subject = "Comment with photo"
 objJMail.Body = "From: " & author & vbcrlf & _
 "E-mail: " & email & vbcrlf &  _
 "Comment: " & text & vbcrlf & _
 "Picture: " & vbcrlf & picturelink & _
 vbcrlf & "--" & vbcrlf & cPageTitle
 objJMail.Priority = 3
 objJMail.Send ("yoursmtp.server.com")
 Set objJMail = Nothing
 
Thanks for thinking with me.


Posted By: dpyers
Date Posted: 19 September 2005 at 7:57pm
Yeah, IIRC, Sender and From are actually two different things in Jmail. I think From has to be a valid Email account on your mail server but Sender can be anything you want to appear in the "From" field of the actual email. If you don't specify Sender, the email "From" defaults to the Jmail From.


-------------

Lead me not into temptation... I know the short cut, follow me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net