Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2010
    Posts
    1

    Red face Unanswered: 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

  2. #2
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •