473,796 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems sending Email using ASP.NET

Hi,

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

public void SendEmail(strin g From, string To, string Subject, StringBuilder
Message, string Attachment, string mailFormat)
{
MailMessage mailMessage = new MailMessage ();
mailMessage.Fro m = From;
mailMessage.To = To;
mailMessage.Sub ject = Subject;
mailMessage.Bod y = Message.ToStrin g ();

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

SmtpMail.SmtpSe rver = "10.0.0.1";
SmtpMail.Send (mailMessage);
}

This code executes fine without error. But the email goes and sits in the
"C:\Inetpub\mai lroot\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
3 1603
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******** *******@TK2MSFT NGP15.phx.gbl.. .
Hi,

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

public void SendEmail(strin g From, string To, string Subject,
StringBuilder
Message, string Attachment, string mailFormat)
{
MailMessage mailMessage = new MailMessage ();
mailMessage.Fro m = From;
mailMessage.To = To;
mailMessage.Sub ject = Subject;
mailMessage.Bod y = Message.ToStrin g ();

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

SmtpMail.SmtpSe rver = "10.0.0.1";
SmtpMail.Send (mailMessage);
}

This code executes fine without error. But the email goes and sits in the
"C:\Inetpub\mai lroot\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

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******** *******@TK2MSFT NGP10.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******** *******@TK2MSFT NGP15.phx.gbl.. .
Hi,

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

public void SendEmail(strin g From, string To, string Subject,
StringBuilder
Message, string Attachment, string mailFormat)
{
MailMessage mailMessage = new MailMessage ();
mailMessage.Fro m = From;
mailMessage.To = To;
mailMessage.Sub ject = Subject;
mailMessage.Bod y = Message.ToStrin g ();

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

SmtpMail.SmtpSe rver = "10.0.0.1";
SmtpMail.Send (mailMessage);
}

This code executes fine without error. But the email goes and sits in the "C:\Inetpub\mai lroot\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
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******** *******@TK2MSFT NGP10.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******** *******@TK2MSFT NGP15.phx.gbl.. .
Hi,

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

public void SendEmail(strin g From, string To, string Subject,
StringBuilder
Message, string Attachment, string mailFormat)
{
MailMessage mailMessage = new MailMessage ();
mailMessage.Fro m = From;
mailMessage.To = To;
mailMessage.Sub ject = Subject;
mailMessage.Bod y = Message.ToStrin g ();

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

SmtpMail.SmtpSe rver = "10.0.0.1";
SmtpMail.Send (mailMessage);
}

This code executes fine without error. But the email goes and sits in the "C:\Inetpub\mai lroot\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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2894
by: dan glenn | last post by:
I'm creating HTML emails from a PHP site and sending them out to an email list (just about 40 people so far are on this list). I've tested and confirmed that these emails work in yahoo.com's webmail. And I know they work on *my* Outlook Express. But I have one person (I know of) who gets the emails as plain text, so she sees the HTML code for the email instead of its proper representation. She has, like myself, OE6, and other html emails...
0
4663
by: Nitec Dev | last post by:
Our setup: server1 ASP database running on IIS5, Outlook 2000 and SQL 2000 on Windows 2000. Server2 runs Windows 2000 with Exchange 2000 using CDO 1.2 MAPI Sessions. Clients use IE5/6 and had Outlook 2000 installed. Upgraded to ASP running on IIS6, Outlook 2000 and SQL 2000 on Windows 2003. Server2 runs windows 2003 with Exchange 2003 using CDO 1.2 MAPI Sessions. Clients use IE5/6 and have Outlook 2000/2003 installed.
2
5261
by: Tim V. | last post by:
Here's the layout: AIX v5.2, DB2 v8 fp8 running in 64bit I've got a Multi-partitioned db running on lpar4 and I want to connect it to 2 instances running on lpar13. We'll deal with just 1 instance on lpar13 for now. lpar4 -> db name dwdb lpar13 -> db name IBMEDGE On lpar13, I have a userid that has DBADMIN authority.
1
627
by: shots86 | last post by:
I am having problems sending emails via the CDO.Message object from an ASP script which was working fine. On the server I can still send emails via the CDO.Message from a .vbs script executed on the desktop. If I pause the SMTP service I can see mails queuing up from the .vbs script but the ASP script no longer generates emails, nor does it error when it creates the object. Could this be a permissions problem? No IIS settings have...
16
2540
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client uses IE to talk with a server. The user on the client (IE) sees an ASP net page containing a TextBox. He can write some text in this text box and push a submit button.
3
4281
by: armando perez | last post by:
Hi, this is my first time here, but I was looking for something that may help me, and still, I haven't found something to use. I'm using a website made in .NET with C#, when I'm running my site from my PC, everything seems right, but when I publish the website, and send it to my real website, everything works but the mail sending. I have red some groups and topics, and everywhere I can found: - Use the following syntax: <system.net>
8
2501
by: Mike Owen | last post by:
Hi, I am using the following code to send email on a Windows 2003 Web Server: Imports System.Net.Mail ........ Dim msgmail As New MailMessage msgmail.To.Add(New MailAddress(objMember.EmailAddress)) msgmail.From = New
2
3623
by: oliu321 | last post by:
Hi, First I am not trying to write a client to talk with hotmail straightly. I am trying to write some codes to send emails through a SMTP server. I wrote a C++ version using pure socket programming and SMTP protocol, a VB version using CDO and a C# version using System.Net.Mail. Now all of them works great with any email account but hotmail. So here is the C# code:
71
19141
by: desktop | last post by:
I have read in Bjarne Stroustrup that using malloc and free should be avoided in C++ because they deal with uninitialized memory and one should instead use new and delete. But why is that a problem? I cannot see why using malloc instead of new does not give the same result.
5
3949
by: Dave | last post by:
Hi All, I'm experiencing problems with sending mail using mail() to forwarded email accounts. The problem seems to revolve around the optional 4th argument of mail(), namely 'additional headers'. It seems that when I populate this 4th argument of mail(), any emails sent to an email forwarding service email address (ukreg/fasthosts actually) fail to reach their destination. Direct email addresses seem to work fine.
0
9524
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10003
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7546
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.