Help Needed with SMTP mail in ASP.Net

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Help Needed with SMTP mail in ASP.Net

    Hi All,

    I am getting an error Could not access 'CDO.Message' object when I run
    the SmtpMail.Send(msg) line as shown below:

    Dim msg As MailMessage = New MailMessage
    msg.To = strRecipientEmailAddressList
    msg.From = strSenderEmailAddress
    msg.Subject = "SimpleERouting AutoNotify Message"
    msg.Body = "SimpleERouting Number " + strErouting + "
    AutoNotify Message From " + strCreator
    SmtpMail.SmtpServer = "localhost"
    SmtpMail.Send(msg)

    This is on my development computer using IIS5.0

    Please help!!

    Thanks,

    Bob Hanson
    CEO
    Custom Programming Unlimited LLC

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Robert Hanson Guest

  2. Similar Questions and Discussions

    1. SMTP mail retreival
      I am using CF 6.1, and need to connect to an exchange mail server running SMTP, to read emails. I have tried CFPOP, but it doesn't seem to work, I...
    2. SMTP / POP3 HELP NEEDED
      All: Set up the SMTP Service on a Windows 2003 Standard Edition. Users configured Outlook can send, but will not receive any e-mail, internal...
    3. Net::SMTP - mail with realname?
      Hi, I can not send email with a realname in the From: field. Exim returns the following error: SMTP MAIL command failed: <"My Test User"...
    4. php mail() and SMTP
      Is there any way to set up the php mail() function so that it sends a username and password to the server? I'm on a winXP machine, and I have an...
    5. SMTP MAIL PROBLEM?
      Hi all I am trying to send email on ASP.NET using smtp mail...but I am getting error.... Could not access 'CDO.Message' object. I use the same...
  3. #2

    Default Re: Help Needed with SMTP mail in ASP.Net

    Hello David,

    I did try that first and I received the same error. Is there something
    in particular is IIS5.0 settings that could cause this?

    Thanks for your help!

    Bob Hanson
    CEO
    Custom Programming Unlimited LLC

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Robert Hanson Guest

  4. #3

    Default Re: Help Needed with SMTP mail in ASP.Net

    Hello Robert,

    You should check the exception that the SmptMail.Send throws. Look through the .InnerException chain until you arrive on a
    COMExeption; this one will include the error message thrown by the SMTP server (you'll probably want to send mails with a
    "from" account that is not in the domain of your SMTP server; this leads to a 500 error from SMTP, which in turn pops up as a
    "cannot access CDO.Message" in your app).

    Please also make sure the SMTPSVC service was started, and you have granted relay permissions to 127.0.0.1, etc.

    By the way, ASP.NET, as we know, runs as the under-privileged user "ASPNET" on the local machine. This user does not
    have privileges to access the network an create sockets (such as the socket necessary to connect to the SMTP server to
    send the mail).

    It DOES, however, have privileges to create a socket to the local machine (127.0.0.1 localhost).

    So if you plan on using SmtpMail from an ASP.NET app, you MUST use your local SMTP Service, and not an external one.

    Thanks.

    Best regards,
    Yanhong Huang
    Microsoft Online Partner Support

    Get Secure! - [url]www.microsoft.com/security[/url]
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    !From: Robert Hanson <roberth@cpuandsimplepdm.com>
    !References: <0d8d01c35130$3c7163d0$a601280a@phx.gbl>
    !X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
    !Subject: Re: Help Needed with SMTP mail in ASP.Net
    !Mime-Version: 1.0
    !Content-Type: text/plain; charset="us-ascii"
    !Content-Transfer-Encoding: 7bit
    !Message-ID: <eTVHGvTUDHA.2420@TK2MSFTNGP10.phx.gbl>
    !Newsgroups: microsoft.public.dotnet.framework.aspnet
    !Date: Wed, 23 Jul 2003 09:59:24 -0700
    !NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
    !Lines: 1
    !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
    !Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:161440
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    !
    !Hello David,
    !
    !I did try that first and I received the same error. Is there something
    !in particular is IIS5.0 settings that could cause this?
    !
    !Thanks for your help!
    !
    !Bob Hanson
    !CEO
    !Custom Programming Unlimited LLC
    !
    !*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    !Don't just participate in USENET...get rewarded for it!
    !


    Yan-Hong Huang[MSFT] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139