sending email using SMTP in asp.net

  • Thread starter Thread starter shansivamani
  • Start date Start date
S

shansivamani

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 : (e-mail address removed)) there are no issues.
but when the mail ids are like ([email protected] or (e-mail address removed)) 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
 
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! |
********************************************
 
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
 
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! |
********************************************
 
Back
Top