If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Error while sending mail using CDO configuration and Message

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-07-10, 06:48
Ashishu Ashishu is offline
Registered User
 
Join Date: Apr 2010
Posts: 1
Red face Error while sending mail using CDO configuration and Message

Hi All,

I have written a code for sending mail to the users of the same domain, where my site is hosted. The code is working fine with my local IIS server but when I deployed my site to host server, then it creates problem.

below are my code

Const sch = "http://schemas.microsoft.com/cdo/configuration/"

Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort*
.Item(sch & "smtpserver") = "smtp.example.com"
.Item(sch & "smtpserverport") = 25
.Item(sch & "smtpauthenticate") = 1
.Item(sch & "sendusername") = "xxx.xxxxx" 'I have also used like "xx.xxxxx@example.com"
.Item(sch & "sendpassword") = "xxxx" ' This is the password I given for this user
.Item(sch & "smtpconnectiontimeout") = 60
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.From = "xx.xxxxx@example.com"
.To = "yy.yyyyy@example.com"
.Subject = strSub
.TextBody = "Test Mail"
.AddAttachment "c:\a.txt"
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing

Problem that I am facing with the above code::

#1. If I use the exactly the same code then it gives me the following error :: error '80040211'
/workingHere/career_thanks.asp, line 180 which is basically at .Send method.

#2. Now if I remove/comment out the following code from the above written code
.Item(sch & "smtpauthenticate") = 1
.Item(sch & "sendusername") = "xxx.xxxxx" 'I have also used like "xx.xxxxx@example.com"
.Item(sch & "sendpassword") = "xxxx" ' This is the password I given for this user

it gives the error
error :: error '8004020e'
/workingHere/career_thanks.asp, line 177 which is also at same place .Send method.

#3. Now if I change the smtpserver as localhost then it does not gives any error but the user does not receive the mail.

#4. If I change the smtpserver as Localhost and change the value of .To field as ccccc@gmail.com, then it works.

I am not able to figure out, what is the problem and how can I resolve it, so I have a humble request that any one have any idea then Please help me because I have already waste my 4 working day but didn't get any clue. so any response will highly appreciate.

Thank you

Regards

Ashish
Reply With Quote
  #2 (permalink)  
Old 04-09-10, 08:12
kitaman kitaman is offline
Papabi's friend
 
Join Date: Sep 2009
Location: Ontario
Posts: 626
It is highly likely that example.com resolves to both an internal and external IP address at the same time, depending upon which side of the firewall you are on.
Reply With Quote
Reply

Tags
8004020e, 80040211, asp error, cdo config & message

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On