sending email using SMTP in asp.net

Discussion in 'ASP .Net' started by shansivamani@gmail.com, Sep 30, 2008.

  1. Guest

    using SMTP to send email.

    is there any settings need to be configured apart from Host name and
    Port, while sending emails using SMTPClient in .Net?
    when i try to send mail to ids which has only one dot in the domain
    name (eg : ) there are no issues.
    but when the mail ids are like ( or ) the
    mail is not getting received by those ids.
    also, there are no exceptions occured when i debugged it.

    this is the code i have used:

    MailMessage msg = new MailMessage(fromId, ToIds);
    SmtpClient client = new SmtpClient();
    client.Host = hostName;
    client.Port = port;
    client.Send(msg);

    thanks,
    shan
    , Sep 30, 2008
    #1
    1. Advertising

  2. SMTP clients have rules who can forward through them. In general, your own
    domain works, but anything other than that domain is refused. This is a
    setting on the mail server, not in the ASP.NET application.

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog
    http://feeds.feedburner.com/GregoryBeamer#

    or just read it:
    http://feeds.feedburner.com/GregoryBeamer

    ********************************************
    | Think outside the box! |
    ********************************************
    <> wrote in message
    news:...
    > using SMTP to send email.
    >
    > is there any settings need to be configured apart from Host name and
    > Port, while sending emails using SMTPClient in .Net?
    > when i try to send mail to ids which has only one dot in the domain
    > name (eg : ) there are no issues.
    > but when the mail ids are like ( or ) the
    > mail is not getting received by those ids.
    > also, there are no exceptions occured when i debugged it.
    >
    > this is the code i have used:
    >
    > MailMessage msg = new MailMessage(fromId, ToIds);
    > SmtpClient client = new SmtpClient();
    > client.Host = hostName;
    > client.Port = port;
    > client.Send(msg);
    >
    > thanks,
    > shan
    Cowboy \(Gregory A. Beamer\), Sep 30, 2008
    #2
    1. Advertising

  3. David Wier Guest

    An email address is an email address and it really shouldn't matter at all.
    Since 'ToIds' is a variable, what format is the variable in (assuming
    multiple email addresses)?

    David Wier
    http://aspnet101.com
    http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
    bloated markup


    <> wrote in message
    news:...
    > using SMTP to send email.
    >
    > is there any settings need to be configured apart from Host name and
    > Port, while sending emails using SMTPClient in .Net?
    > when i try to send mail to ids which has only one dot in the domain
    > name (eg : ) there are no issues.
    > but when the mail ids are like ( or ) the
    > mail is not getting received by those ids.
    > also, there are no exceptions occured when i debugged it.
    >
    > this is the code i have used:
    >
    > MailMessage msg = new MailMessage(fromId, ToIds);
    > SmtpClient client = new SmtpClient();
    > client.Host = hostName;
    > client.Port = port;
    > client.Send(msg);
    >
    > thanks,
    > shan
    David Wier, Sep 30, 2008
    #3
  4. It only matters to the email server, which by default should block addresses
    outside of the domain.

    Years ago, this was not true, and people would find a UNIX/Linux server with
    SendMail in default install. You could then send email through that server
    and it was very hard to trace it back to the originator. Today, the normal
    default is "only from my domain".

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog
    http://feeds.feedburner.com/GregoryBeamer#

    or just read it:
    http://feeds.feedburner.com/GregoryBeamer

    ********************************************
    | Think outside the box! |
    ********************************************
    "David Wier" <> wrote in message
    news:...
    > An email address is an email address and it really shouldn't matter at
    > all.
    > Since 'ToIds' is a variable, what format is the variable in (assuming
    > multiple email addresses)?
    >
    > David Wier
    > http://aspnet101.com
    > http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with
    > no bloated markup
    >
    >
    > <> wrote in message
    > news:...
    >> using SMTP to send email.
    >>
    >> is there any settings need to be configured apart from Host name and
    >> Port, while sending emails using SMTPClient in .Net?
    >> when i try to send mail to ids which has only one dot in the domain
    >> name (eg : ) there are no issues.
    >> but when the mail ids are like ( or ) the
    >> mail is not getting received by those ids.
    >> also, there are no exceptions occured when i debugged it.
    >>
    >> this is the code i have used:
    >>
    >> MailMessage msg = new MailMessage(fromId, ToIds);
    >> SmtpClient client = new SmtpClient();
    >> client.Host = hostName;
    >> client.Port = port;
    >> client.Send(msg);
    >>
    >> thanks,
    >> shan

    >
    >
    Cowboy \(Gregory A. Beamer\), Sep 30, 2008
    #4
    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. bivin
    Replies:
    1
    Views:
    714
    venkat
    Jun 27, 2003
  2. Replies:
    3
    Views:
    1,076
    Roedy Green
    Jan 24, 2006
  3. Alex Hunsley
    Replies:
    4
    Views:
    3,462
    Tim Williams (gmail)
    Jun 29, 2004
  4. Raaijmakers, Vincent \(GE Infrastructure\)

    RE: sending of mail (smtp) - connection refused - but smtp serveris running!

    Raaijmakers, Vincent \(GE Infrastructure\), Jun 29, 2004, in forum: Python
    Replies:
    0
    Views:
    880
    Raaijmakers, Vincent \(GE Infrastructure\)
    Jun 29, 2004
  5. Gabriel Dragffy

    Sending email using net/smtp

    Gabriel Dragffy, Aug 17, 2007, in forum: Ruby
    Replies:
    1
    Views:
    87
    Gabriel Dragffy
    Aug 18, 2007
Loading...

Share This Page