By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,526 Members | 2,207 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,526 IT Pros & Developers. It's quick & easy.

Problems sending Email using ASP.NET

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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" <no*****@email.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
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

Nov 19 '05 #2

P: n/a

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 [MVP - ASP.NET]" <www.lulu.com/owc> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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" <no*****@email.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
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


Nov 19 '05 #3

P: n/a
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" wrote:

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 [MVP - ASP.NET]" <www.lulu.com/owc> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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" <no*****@email.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
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



Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.