Problems sending email

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
 
R

Robbe Morris [C# MVP]

But we had a really odd problem on Windows 2003 Server and sending
mail through our mail server. If our messages had \n instead of \r\n for
end of line, then the mail server just wouldn't send the message.

Very odd. I tested this on several other Windows 2003 Servers and
couldn't duplicate the issue. So, we ended up just changing our code
because Microsoft technical support couldn't provide any assistance.

They were just as baffled.
 
S

Scott Allen

Hi srinivas:

Are there any informational or error messages from the SMTP service in
the event log?
 

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

Top