473,396 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Cdonts mail sending Error

Hello sir,
When iam trying to send emails to my user accounts which are gmail id's using my application it is giving me this error.
Here is the error...
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
Not sending CDONTS created e-mails.

Here is the related code ....
Expand|Select|Wrap|Line Numbers
  1. '********************************************************
  2. 'Creating CDONTS mail object and sending mail to user
  3. '********************************************************
  4.  
  5. Sub SendEmail(Sender, Receiver, Subject, Message)
  6.  
  7.         'response.Write(Sender)
  8.         'response.Write(Receiver)
  9.         'response.Write(Subject)
  10.         'response.Write(Message)
  11.         'response.End()
  12.         'based on hosting server we need to enable mailing component
  13.  
  14.         Set Cdo = Server.CreateObject("CDONTS.NewMail")
  15.         Cdo.From = Sender
  16.         Cdo.To = Receiver
  17.         Cdo.Subject = Subject
  18.         Cdo.Body = Message 'Content
  19.         Cdo.BodyFormat = 0        '--->HTML format
  20.         Cdo.MailFormat = 0        '--->HTML format
  21.         '''Response.Write Message & "<br>" 'Displays the content to be sent to receiver
  22.  
  23.         if    Session("UserType")="Participant" then 
  24.             Cdo.Value("Reply-To") = Session("PEmail")
  25.         else
  26.             Cdo.Value("Reply-To") = Sender
  27.         end if
  28.         'response.Write(Message)
  29.         'response.End()
  30.         Cdo.Send 'Sends the mail
  31.  
  32.         'Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
  33.         'Mailer.FromName = "Assessment"
  34.         'Mailer.FromAddress = "rv@gmail.com"
  35.         'Mailer.RemoteHost = "smtp.gmail.com"
  36.  
  37.         ''Here is where you can change who the email is sent to
  38.  
  39.         'Mailer.AddRecipient strFirstname, strToEmail
  40.  
  41.         'Mailer.ContentType = "text/html"
  42.         'Mailer.Subject = "Assessment:New Account Invitation"
  43.         'Mailer.BodyText = strMailbody
  44.  
  45.         'if Mailer.SendMail then
  46.         'response.Write(strMailbody)
  47.         'response.End()
  48.  
  49.         'Call SendEmail("rv@gmail.com", strToEmail, "Assessment:New Account Invitation", strMailbody)
  50.  
  51. End Sub

Please help....as mails are not going to the clients .....some online forums suggest replacing cdo with some thing called cdomessage.....iam new to this asp and do i need to change them or is there any other way....if i need to change and make it work what changes do i make and where.....this code is in common.asp ...



Thanks...
Jason.
Oct 14 '08 #1
7 3739
DrBunchman
979 Expert 512MB
Hi Jason,

CDONTS is a deprecated object which means that it isn't supported anymore. Take a look at using CDOSYS - there are some excellent examples at w3schools which should help you.

I'd suggest you try one of their example scripts. If you have any problems implementing them then let me know.

Dr B
Oct 14 '08 #2
Hi Jason,

CDONTS is a deprecated object which means that it isn't supported anymore. Take a look at using CDOSYS - there are some excellent examples at w3schools which should help you.

I'd suggest you try one of their example scripts. If you have any problems implementing them then let me know.

Dr B
Sir as per ur direction changed the code as below......


Expand|Select|Wrap|Line Numbers
  1. '********************************************************
  2. 'Creating CDOSYS mail object and sending mail to user
  3. '********************************************************
  4.  
  5. Sub SendEmail(Sender, Receiver, Subject, Message)
  6.  
  7.         'response.Write(Sender)
  8.         'response.Write(Receiver)
  9.         'response.Write(Subject)
  10.         'response.Write(Message)
  11.         'response.End()
  12.         'based on hosting server we need to enable mailing component
  13.  
  14.         Set Cdo = Server.CreateObject("CDO.NewMail")
  15.         Cdo.From = Sender
  16.         Cdo.To = Receiver
  17.         Cdo.Subject = Subject
  18.         Cdo.Body = Message 'Content
  19.         Cdo.BodyFormat = 0        '--->HTML format
  20.         Cdo.MailFormat = 0        '--->HTML format
  21.         Cdo.Configuration.Fields.Item _
  22. ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
  23. 'Name or IP of remote SMTP server
  24. Cdo.Configuration.Fields.Item _
  25. ("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
  26. ="smtp.server.com"
  27. 'Server port
  28. Cdo.Configuration.Fields.Item _
  29. ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
  30. =25 
  31. Cdo.Configuration.Fields.Update
  32.         '''Response.Write Message & "<br>" 'Displays the content to be sent to receiver
  33.  
  34.         if    Session("UserType")="Participant" then 
  35.             Cdo.Value("Reply-To") = Session("PEmail")
  36.         else
  37.             Cdo.Value("Reply-To") = Sender
  38.         end if
  39.         'response.Write(Message)
  40.         'response.End()
  41.         Cdo.Send 'Sends the mail
  42.  
  43.         'Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
  44.         'Mailer.FromName = "360 Assessment"
  45.         'Mailer.FromAddress = "sk@gmail.com"
  46.         'Mailer.RemoteHost = "localhost"
  47.  
  48.         ''Here is where you can change who the email is sent to
  49.  
  50.         'Mailer.AddRecipient strFirstname, strToEmail
  51.  
  52.         'Mailer.ContentType = "text/html"
  53.         'Mailer.Subject = "360 Assessment:New Account Invitation"
  54.         'Mailer.BodyText = strMailbody
  55.  
  56.         'if Mailer.SendMail then
  57.         'response.Write(strMailbody)
  58.         'response.End()
  59.  
  60.         'Call SendEmail("sk@gmail.com", strToEmail, "360 Assessment:New Account Invitation", strMailbody)
  61.  
  62. End Sub
  63.  
but still it is giving this error....

Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/Assessmentweb/Common.asp, line 57


please help....

Thanks...
Jason...
Oct 15 '08 #3
DrBunchman
979 Expert 512MB
Hi Jason,

I think you need to change the line where you create your mail object to

Expand|Select|Wrap|Line Numbers
  1. Set Cdo = CreateObject("CDO.Message")
Does that help?

Also, please don't forget to use the # button in the posting window to surround your code with code tags - they make your posts much easier to read and save me and the other moderators time because we don't have to add them for you!!

Thanks,

Dr B
Oct 15 '08 #4
Hi Jason,

I think you need to change the line where you create your mail object to

Expand|Select|Wrap|Line Numbers
  1. Set Cdo = CreateObject("CDO.Message")
Does that help?

Also, please don't forget to use the # button in the posting window to surround your code with code tags - they make your posts much easier to read and save me and the other moderators time because we don't have to add them for you!!

Thanks,

Dr B
Sir Tried changing that line as u told no change ...same error is being displayed ...no change in error message also....

Thanks..
Jason.
Oct 15 '08 #5
can some one help me with this error please......


Thanks...
Jason.
Oct 17 '08 #6
DrBunchman
979 Expert 512MB
Jason,

I've lifted the code below directly from the w3schools page that I linked to above.

Expand|Select|Wrap|Line Numbers
  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.Send
  8. set myMail=nothing
  9. %>
If you run this script and you still get the error then perhaps you don't have the CDOSYS.dll installed on your deployment machine? What version of windows/windows server is running on that machine?

Dr B
Oct 17 '08 #7
Jason,

I've lifted the code below directly from the w3schools page that I linked to above.

Expand|Select|Wrap|Line Numbers
  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.Send
  8. set myMail=nothing
  9. %>
If you run this script and you still get the error then perhaps you don't have the CDOSYS.dll installed on your deployment machine? What version of windows/windows server is running on that machine?

Dr B

hello sir

i ran this but did not get any error ...i ran a script that check for CDOSYS and it says that it is installed....so i also put this script that u gave now and put response.write and when i open the page no error....i get the message...

so what do u say do i need to change any thing on local host to try it ....i specified gmail ids ....did not specify any ports particularly.....


so please let me know ....

thanks..
jason.
Oct 17 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: praba kar | last post by:
Dear All, I have doubt regarding mail sending smtplib module. The below code is I used to send a mail. ########################################## import email.Message import email.Utils...
1
by: praba kar | last post by:
Dear All, Is it possible to send a message as a mail with out smtplib module? If you find out any module for mail sending(without smtplib) kindly mail me. regards Prabahar
1
by: Chris | last post by:
I get the follow error on a linux box that is running sun asp: CDONTS.NewMail.1 error '80020009' unable to connect to server The error occurs when the Send Command is Executed. Here is my code...
9
by: -Nacho- | last post by:
Hi all I have a table with some email addresses of a mailing list subscribers. I'm triying to send a mail to them by querying the table and sending the mail from a 'while' loop, but I only get...
3
by: Ibrahim. | last post by:
Hello, Im getting the following error when mail is sent from ASP.NET 2.0 website. CDO.Messaging componenet is used for sending mail. " The message was not able to be transmitted to the SMTP...
0
by: Lakshmanakumar | last post by:
hi all, I am using an Object CDONTS for sending mail. with this i have an problem in sending image.All other text information had send but the image can't send. how can i overcome this problem...
2
by: Mitesh | last post by:
I am facing the error while executing the mail sending application: The "SendUsing" configuration value is invalid. The error is in the line: SmtpMail.Send(msg); Please guide me.
2
by: rameshcse2005 | last post by:
i caught by this error while sending mail using System.net.mail class System.Net.Mail.SmtpException: Error in processing. The server response was:...
3
by: swethak | last post by:
Hi, i placed the php in windows server 2003 manually , set the path in Environmental variables , and place the php.ini file in windows. Now php works fine in my server sytem.When i write the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.