473,471 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

sending email using SMTP in asp.net

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 : te**@abc.com) there are no issues.
but when the mail ids are like (te**@abc.co.in or te**@abc.rr.com) 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 '08 #1
3 1739
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! |
********************************************
<sh**********@gmail.comwrote in message
news:82**********************************@l76g2000 hse.googlegroups.com...
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 : te**@abc.com) there are no issues.
but when the mail ids are like (te**@abc.co.in or te**@abc.rr.com) 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 '08 #2
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
<sh**********@gmail.comwrote in message
news:82**********************************@l76g2000 hse.googlegroups.com...
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 : te**@abc.com) there are no issues.
but when the mail ids are like (te**@abc.co.in or te**@abc.rr.com) 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 '08 #3
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" <dw@dw.comwrote in message
news:e6**************@TK2MSFTNGP04.phx.gbl...
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
<sh**********@gmail.comwrote in message
news:82**********************************@l76g2000 hse.googlegroups.com...
>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 : te**@abc.com) there are no issues.
but when the mail ids are like (te**@abc.co.in or te**@abc.rr.com) 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 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: joe215 | last post by:
I want my users to send emails from a Windows app that I am developing in Visual Basic.NET 2003. I found a good example of sending email to a SMTP server using the SmtpMail class. However, using...
8
by: Frank | last post by:
I think I've confused myself completely here :-) I have used System.Web.Mail, but am not sure if this works with Exchange Server 5.5. I asked the client if they're email server supported SMTP, and...
9
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on...
3
by: Ant | last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send mail, however it's not sending any emails. I'm using it on a Windows 2003 server. The simplest way to use this is...
6
by: Anuradha | last post by:
Dear All How can i send mails using vb.net Thanx all
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
8
by: Robert Dufour | last post by:
Dim message As New MailMessage("mymail@mydomain.com", "mymail@mydomain.com", "Test", "Test") Dim emailClient As New SmtpClient("localhost") emailClient.Send(message) The IIS server is...
2
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
6
by: Jack | last post by:
Hi, I am still new to .NET so, i'm sorry if my question is a bit too simple :-) I would like to know what is the "best-practice-way" of sending email from asp.net (VbScript). I want to make a...
31
by: happyse27 | last post by:
Hi All, I am trying for weeks how to send email from windows pc, which from my gmail account to my hotmail account. Using net::smtp module sending email failed,Kindly assist. (for the item d it...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.