[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

CDO , not  mail sending !

Posted on 2008-10-06
6
Medium Priority
?
705 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Hello Friends, My friends and relatives always ask me how to delete all the various types of emails at once in our g-mail  or windows live account.  So I researched this topic to find a unique solution to this query.  Here it is for those who do …
Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

649 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