Solved

CDO , not  mail sending !

Posted on 2008-10-06
6
685 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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 500 total points
ID: 22662389
0
 

Author Closing Comment

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

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Pop culture is prime bait for hackers seeking to infect user’s computers and mobile devices with malicious malware. Hackers know exactly what the latest trends are online and know how to use them to their advantage.
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.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

770 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