943,794 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 1542
  • ASP RSS
Dec 21st, 2008
0

Sending e-mail in ASP

Expand Post »
I got this script from one ASP tutorial (click here to see it):

asp Syntax (Toggle Plain Text)
  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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Vladimirr is offline Offline
14 posts
since Dec 2006
Dec 22nd, 2008
0

Re: Sending e-mail in ASP

Don't use CDONTS... it was replaced years ago by CDOSYS.
Reputation Points: 25
Solved Threads: 7
Junior Poster
Drew is offline Offline
166 posts
since Apr 2004
Dec 22nd, 2008
0

Re: Sending e-mail in ASP

Click to Expand / Collapse  Quote originally posted by Drew ...
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Vladimirr is offline Offline
14 posts
since Dec 2006
Dec 22nd, 2008
0

Re: Sending e-mail in ASP

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
Reputation Points: 25
Solved Threads: 7
Junior Poster
Drew is offline Offline
166 posts
since Apr 2004
Dec 22nd, 2008
0

Re: Sending e-mail in ASP

Click to Expand / Collapse  Quote originally posted by Drew ...
If your getting a 500 error, you need to turn off Friendly HTTP Error Messages
How do I do that?

Click to Expand / Collapse  Quote originally posted by Drew ...
... and stop using IE
Will "FireFox" work?
Last edited by Vladimirr; Dec 22nd, 2008 at 6:46 am.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Vladimirr is offline Offline
14 posts
since Dec 2006
Dec 22nd, 2008
0

Re: Sending e-mail in ASP

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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Vladimirr is offline Offline
14 posts
since Dec 2006
Dec 28th, 2008
1

Re: Sending e-mail in ASP

on what you posted, you need quotes around the email addresses:
ASP Syntax (Toggle Plain Text)
  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:
ASP Syntax (Toggle Plain Text)
  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.
Reputation Points: 116
Solved Threads: 243
Veteran Poster
hielo is offline Offline
1,123 posts
since Dec 2007
Dec 28th, 2008
0

Re: Sending e-mail in ASP

WOW!!! Thank You very much!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Vladimirr is offline Offline
14 posts
since Dec 2006
Dec 28th, 2008
0

Re: Sending e-mail in ASP

you are welcome
Reputation Points: 116
Solved Threads: 243
Veteran Poster
hielo is offline Offline
1,123 posts
since Dec 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: E Card system
Next Thread in ASP Forum Timeline: How to call asp function in anchor tag





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC