Sending e-mail in ASP

Reply

Join Date: Dec 2006
Posts: 14
Reputation: Vladimirr is an unknown quantity at this point 
Solved Threads: 0
Vladimirr Vladimirr is offline Offline
Newbie Poster

Sending e-mail in ASP

 
0
  #1
Dec 21st, 2008
I got this script from one ASP tutorial (click here to see it):

  1. <%
  2. Set myMail=CreateObject("CDO.Message")
  3. myMail.Subject="Sending email with CDO"
  4. myMail.From=mymail@mydomain.com
  5. myMail.To=someone@somedomain.com
  6. myMail.TextBody="This is a message."
  7. myMail.Sendset
  8. myMail=nothing
  9. %>

replaced mymail@mydomain.com and someone@somedomain.com with
2 mail addresses of two mail-boxes that I have on www.yahoo.com and
uploaded this script (as an .asp file) on a free asp-supported remote
server. Then I tried to open the link to this file in my web browser (IE6) -
nothing happened (only got an HTTP 500 page) - and when I checked
my mailbox, I didn't find any new e-mail there. What did I do wrong or
what did I not do?
Last edited by peter_budo; Dec 29th, 2008 at 11:37 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 167
Reputation: Drew is an unknown quantity at this point 
Solved Threads: 7
Drew's Avatar
Drew Drew is offline Offline
Junior Poster

Re: Sending e-mail in ASP

 
0
  #2
Dec 22nd, 2008
Don't use CDONTS... it was replaced years ago by CDOSYS.
Drew Gauderman
ASP / MSSQL Coder
http://www.iportalx.net - My ASP Portal
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 14
Reputation: Vladimirr is an unknown quantity at this point 
Solved Threads: 0
Vladimirr Vladimirr is offline Offline
Newbie Poster

Re: Sending e-mail in ASP

 
0
  #3
Dec 22nd, 2008
Originally Posted by Drew View Post
Don't use CDONTS... it was replaced years ago by CDOSYS.
Strange, I thougnt this script was using CDOSYS. I took this
script from here: www.w3schools.com/asp/asp_send_email.asp
and look what they said there right before presenting this script:

"...Microsoft has discontinued the use of DONTs on
Windows 2000, Windows XP and Windows 2003.
If you have used CDONTs in your ASP applications,
you should update the code and use the new CDO
technology.

Examples using CDOSYS
Sending a text e-mail:
..."

and then my script follows. Are you sure it is still using CDONT?
If yes, what CDOSYS script do I need to be able to send mails
in ASP?
Last edited by Vladimirr; Dec 22nd, 2008 at 4:21 am.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 167
Reputation: Drew is an unknown quantity at this point 
Solved Threads: 7
Drew's Avatar
Drew Drew is offline Offline
Junior Poster

Re: Sending e-mail in ASP

 
0
  #4
Dec 22nd, 2008
Ooops my bad i only say a few lines and just assumed it was CDONTS.

If your getting a 500 error, you need to turn off Friendly HTTP Error Messages and stop using IE
Drew Gauderman
ASP / MSSQL Coder
http://www.iportalx.net - My ASP Portal
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 14
Reputation: Vladimirr is an unknown quantity at this point 
Solved Threads: 0
Vladimirr Vladimirr is offline Offline
Newbie Poster

Re: Sending e-mail in ASP

 
0
  #5
Dec 22nd, 2008
Originally Posted by Drew View Post
If your getting a 500 error, you need to turn off Friendly HTTP Error Messages
How do I do that?

Originally Posted by Drew View Post
... and stop using IE
Will "FireFox" work?
Last edited by Vladimirr; Dec 22nd, 2008 at 6:46 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 14
Reputation: Vladimirr is an unknown quantity at this point 
Solved Threads: 0
Vladimirr Vladimirr is offline Offline
Newbie Poster

Re: Sending e-mail in ASP

 
0
  #6
Dec 22nd, 2008
Well, I swiched to "FireFox" and now I am always
getting this message:

CDO.Message.1error '80040220'
The "SendUsing" configuration value is invalid.



Any idea what it means and how it could be fixed?
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 113
Reputation: hielo is on a distinguished road 
Solved Threads: 17
hielo hielo is offline Offline
Junior Poster

Re: Sending e-mail in ASP

 
1
  #7
Dec 28th, 2008
on what you posted, you need quotes around the email addresses:
  1. myMail.From="mymail@mydomain.com"
  2. myMail.To="someone@somedomain.com"

Also, this is not right:
myMail.Sendset

The "Set" should be on the start of the next line:
  1. myMail.Send
  2. Set myMail=nothing

>>uploaded this script (as an .asp file) on a free asp-supported remote server
>>>CDO.Message.1error '80040220'
The "SendUsing" configuration value is invalid.
Do you know if the server is running a local smtp server? Most likely it is NOT. On the tutorial page you posted, you basically need to use the last example, but you need to modify:
"smtp.server.com"

with the value of the appropriate smtp server. Contact your webhost and ask them what is their smtp address. As documented on the comment of that example:
'Name or IP of remote SMTP server

you can use either an IP address OR a domain name.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 14
Reputation: Vladimirr is an unknown quantity at this point 
Solved Threads: 0
Vladimirr Vladimirr is offline Offline
Newbie Poster

Re: Sending e-mail in ASP

 
0
  #8
Dec 28th, 2008
WOW!!! Thank You very much!
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 113
Reputation: hielo is on a distinguished road 
Solved Threads: 17
hielo hielo is offline Offline
Junior Poster

Re: Sending e-mail in ASP

 
0
  #9
Dec 28th, 2008
you are welcome
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC