?
Solved

CDO , not  mail sending !

Posted on 2008-10-06
6
Medium Priority
?
697 Views
Last Modified: 2013-11-30
Hello,

I am trying to send mails using the CDOSYS object.
But it says , mail sent but mail does not reach me, instead it gives delivery notification (failed),
the mail cud not b delivered to the following email address.

Please help me fast.
'THE MAIL OBJECT 
 Dim ObjMail 
 Set ObjMail = Server.CreateObject("CDO.Message") 
sendUrl="http://schemas.microsoft.com/cdo/configuration/sendusing"
smtpUrl="http://schemas.microsoft.com/cdo/configuration/smtpserver"
 
 
' Set the mail server configuration
Set objConfig=CreateObject("CDO.Configuration")
objConfig.Fields.Item(sendUrl)=cdoSendUsingPickup ' cdoSendUsingPort
objConfig.Fields.Item(smtpUrl)="relay-hosting.secureserver.net"
objConfig.Fields.Update
' Use the config object created above
Set objMail.Configuration=objConfig
 
 
 objMail.From =  "ahdsan@yahoo.co.in" 
 objMail.To = "quickonline.us1@gmail.com"
 objMail.Subject = "Mahesh Tutorials"
 objMail.HTMLBody = a1
 objMail.Send 
 
 Set objMail = Nothing 
 Set objConfig = Nothing

Open in new window

0
Comment
Question by:Desire2change
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 22648521
it should be because of the improper mail address or mail settings. also please ensure that gmail will not allow automated mails and check your mail quota.
0
 

Author Comment

by:Desire2change
ID: 22652431
but it is not going to hotmail either.
and i chked with the hosting server, the configuration settings and code everything i have picked up from the hosting server, so i don't think there will b problem with the settings.
please guide me i am clueless.
I am getting the following error :

error '8004020e'
/sendinvoice.asp, line 197
0
 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 22652556
I believe that you are sending mail from yahoo. if that is the case then ensure that yahoo allows send mail via smtp.
if you are using gmail then it uses SSL layer then try the below given code

Sub sendmail()
Dim iMsg As Object
Dim iConf As Object

Dim Flds As Variant

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")

iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "yourmail@gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpasswordhere"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

strbody = "Your Sample message "

With iMsg
Set .Configuration = iConf
.To = sendto
.CC = ""
.BCC = ""
' Note: The reply address is not working if you use this Gmail example
' It will use your Gmail address automatic. But you can add this line
' to change the reply address .ReplyTo = "Reply@something.com"
.From = "<your mailid to be displayed as@gmail.com>"
.Subject = "subject here"
.TextBody = strbody
.Send
End With

End Sub
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Desire2change
ID: 22661392
i used the above code and am getting the following error :

CDO.Message.1 error '80040213'

The transport failed to connect to the server.

/sendinvoice.asp, line 204
0
 
LVL 17

Accepted Solution

by:
Shanmuga Sundaram earned 1500 total points
ID: 22662389
0
 

Author Closing Comment

by:Desire2change
ID: 31503346
The links helped me to find the solution
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There was an incident about the POP3 issue for the double read receipts and delivery receipts in Exchange 2013.  There was huge research been done and found solution for the duplicate mails. Especially when the user gets  duplicate mails.
When you’re making plans to join the modern business race, you should analyze various details that may affect your results. Nowadays, millions of businesses are trying to grow into established and appreciated professional enterprises.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question