SMTP Email problems

S

Srinivas

Hi,

I am using ASP.NET SmtpMail to send email using the following code

public void SendEmail(string From, string To, string Subject, StringBuilder
Message, string Attachment, string mailFormat)
{
MailMessage mailMessage = new MailMessage ();
mailMessage.From = From;
mailMessage.To = To;
mailMessage.Subject = Subject;
mailMessage.Body = Message.ToString ();

if(mailFormat == "T")
{
mailMessage.BodyFormat = MailFormat.Text;
}
else if(mailFormat == "H")
{
mailMessage.BodyFormat = MailFormat.Html;
}

SmtpMail.SmtpServer = "10.0.0.1";
SmtpMail.Send (mailMessage);
}

This code executes fine without error. But the email goes and sits in the
"C:\Inetpub\mailroot\Queue" folder.
SMTP service is running and cdosys.dll and cdonts.dll are installed.

My computer is connected to the internet through a Speedtouch 545 ADSL
router. I got the "10.0.0.1" by doing the ipconfig at command prompt.

Can anyone please guide me in the right direction.

Thanks,

Srinivas
 
W

Wysiwyg

Srinivas,

If you are running Windows check the Internet Services Manager and make sure
your "Default SMTP Virtual Server" is running. Where are you getting your
email from? If you are connecting to an ISP's mail server rather than
running your own mail server then you'll need to configure the SMTP service
properties to forward to the mail server you usually connect to with the
mail client and authenticate with your user and password. Also, make sure
your SMTP service doesn't allow relaying by anyone other than your address
if you have a static IP address.

Do you have a static IP address? How are you connecting to the internet? If
you send email from your own server rather than connecting via a client,
i.e. outlook, to your ISP's mail server the mail shows as coming from your
IP address. In order to prevent spammers from opening an account running
spamware from a dynamically assigned IP address some ISPs won't relay your
mail this way and some other ISPs will reject email sent from a dynamic IP
address. So, test by sending to yourself first before dealing with the other
possible complications.

That's just a quick reply based on what I think is the likely situation.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top