Problems sending Email using ASP.NET

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
 
A

Alvin Bruney [MVP - ASP.NET]

have you tried replacing the ip with "localhost". see if that works

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc, Amazon, B&H etc


Forth-coming VSTO.NET
 
S

Srinivas

I have tried using localhost, 127.0.0.1, computer name. But the result was
the same. There is a firewall in Speedtouch 545 ADSL. I am not sure whether
it is because of the firewall, because I am able to use Outlook Express
without any problems.

Thanks


Alvin Bruney said:
have you tried replacing the ip with "localhost". see if that works

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc, Amazon, B&H etc


Forth-coming VSTO.NET
-------------------------------------------------------------------------- -----
Srinivas said:
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
 
G

Guest

I dont know why this is but I did that as a test on my machine at home and it
sat there until I rebooted or restarted IIS. So that might be a good start
for you, I didnt investigate it b/c I was just testing some code out but it
might help you find the answer.

Cleako

Srinivas said:
I have tried using localhost, 127.0.0.1, computer name. But the result was
the same. There is a firewall in Speedtouch 545 ADSL. I am not sure whether
it is because of the firewall, because I am able to use Outlook Express
without any problems.

Thanks


Alvin Bruney said:
have you tried replacing the ip with "localhost". see if that works

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc, Amazon, B&H etc


Forth-coming VSTO.NET
-------------------------------------------------------------------------- -----
Srinivas said:
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
 

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

Similar Threads


Top