using System.Web.Mail ?

Discussion in 'ASP .Net' started by Guest, Jul 31, 2007.

  1. Guest

    Guest Guest

    I received an unhandles exception in my email form as follows

    Dim mo As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
    mo.Body = "test"
    mo.To =
    Dim a As System.Web.Mail.SmtpMail
    a.Send(mo)

    Line 8: mo.To = ""
    Line 9: Dim a As System.Web.Mail.SmtpMail
    Line 10: a.Send(mo)
    Line 11:
    Line 12: %>Thanks in advance
    Guest, Jul 31, 2007
    #1
    1. Advertising

  2. <femi> wrote in message news:...

    > I received an unhandles exception in my email form as follows


    Sigh - and what does the unhandled exception say...?


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
    Mark Rae [MVP], Jul 31, 2007
    #2
    1. Advertising

  3. Guest

    James Guest

    Also, set your "from" property.

    "Mark Rae [MVP]" <> wrote in message
    news:O6V%23A$...
    > <femi> wrote in message news:...
    >
    >> I received an unhandles exception in my email form as follows

    >
    > Sigh - and what does the unhandled exception say...?
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    James, Jul 31, 2007
    #3
  4. Guest

    Guest Guest

    The server rejected one or more recipient addresses. The server response
    was: 550 5.7.1 Unable to relay for
    this is strange, I used a similar form with cdonts and asp and
    I don't get this error, it's on the same server, as follows:

    Set objCDONTSMail = CreateObject("CDONTS.NewMail")
    objCDONTSMail.From =
    objCDONTSMail.To =
    objCDONTSMail.subject = "ghghghg"
    objCDONTSMail.Body = "saassasa"
    objCDONTSMail.Send

    This works, so why the aspx scripts is unable to relay?
    Guest, Jul 31, 2007
    #4
  5. Guest

    Aidy Guest

    That's an error from the SMTP server saying it can't deliver the message.
    This is nothing to do with your code per se. Are you specifying an SMTP
    server to send the mail through? It seems that server can't relay the
    message on.

    <femi> wrote in message news:...
    > The server rejected one or more recipient addresses. The server response
    > was: 550 5.7.1 Unable to relay for
    > this is strange, I used a similar form with cdonts and asp and
    > I don't get this error, it's on the same server, as follows:
    >
    > Set objCDONTSMail = CreateObject("CDONTS.NewMail")
    > objCDONTSMail.From =
    > objCDONTSMail.To =
    > objCDONTSMail.subject = "ghghghg"
    > objCDONTSMail.Body = "saassasa"
    > objCDONTSMail.Send
    >
    > This works, so why the aspx scripts is unable to relay?
    >
    >
    Aidy, Jul 31, 2007
    #5
  6. Guest

    Guest Guest

    > This is nothing to do with your code per se. Are you specifying an SMTP
    > server to send the mail through? It seems that server can't relay the
    > message on.


    I am not, but neither do I with old fashioned cdonts, so are you saying
    there can be a sutuation where cdonts knows where smtp is and
    aspdotnet doesn't know? I'd rather not specify this, so that it will pick
    up what is appropriate without my intervention (portable script).

    If not, how can I find which smtp cdonts is using, so that I can install
    this info into my asp.net script.

    Thanks in advance
    Guest, Jul 31, 2007
    #6
  7. Guest

    sloan Guest

    Downloadable examples for 1.1 and 2.0 can be found at:

    http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry

    .................

    There are different rules depending on which smtp server you're trying to
    use.

    The downloadable code samples will make this more clear.




    <femi> wrote in message news:...
    >I received an unhandles exception in my email form as follows
    >
    > Dim mo As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
    > mo.Body = "test"
    > mo.To =
    > Dim a As System.Web.Mail.SmtpMail
    > a.Send(mo)
    >
    > Line 8: mo.To = ""
    > Line 9: Dim a As System.Web.Mail.SmtpMail
    > Line 10: a.Send(mo)
    > Line 11:
    > Line 12: %>Thanks in advance
    >
    >
    sloan, Jul 31, 2007
    #7
  8. http://www.systemwebmail.com/faq/4.3.11.aspx




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en espaƱol : http://asp.net.do/foros/
    ======================================
    <femi> wrote in message news:...
    >> This is nothing to do with your code per se. Are you specifying an SMTP
    >> server to send the mail through? It seems that server can't relay the
    >> message on.

    >
    > I am not, but neither do I with old fashioned cdonts, so are you saying
    > there can be a sutuation where cdonts knows where smtp is and
    > aspdotnet doesn't know? I'd rather not specify this, so that it will pick
    > up what is appropriate without my intervention (portable script).
    >
    > If not, how can I find which smtp cdonts is using, so that I can install
    > this info into my asp.net script.
    >
    > Thanks in advance
    >
    >
    Juan T. Llibre, Jul 31, 2007
    #8
  9. Guest

    Guest Guest

    Thank you, but no answers there,


    My cdonts object on the same host does relay to any address

    WebMail however, (on same host) doesn't replay, but now I
    found that it will relay locally, i.e. back to myself.

    Since cdonts does work, my logic tells me it can't be an smtp
    issue.
    Guest, Aug 1, 2007
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Unlhbg==?=
    Replies:
    2
    Views:
    3,881
    Steven Cheng[MSFT]
    Feb 28, 2006
  2. Brad
    Replies:
    2
    Views:
    9,721
  3. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    System.Net.Mail vs System.Web.Mail

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, Jun 16, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    10,586
    Walter Wang [MSFT]
    Jun 16, 2006
  4. Nathan Sokalski
    Replies:
    5
    Views:
    902
    Spam Catcher
    Dec 12, 2006
  5. Frank
    Replies:
    10
    Views:
    855
    Juan T. Llibre
    Mar 29, 2007
Loading...

Share This Page