473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Send Email in ASP .net

35
Hi,
I need to send email in ASP .net(vb .net) using smtp. i have found that i can use smtpmail.send() to send email.....but the problem is the page doent show any error and the mail is not received in my inbox too.....i have changed some settings in IIS(default virtual server properties). In the access tab->and on connection i have added 127.0.0.1 ip address....but i have a doubt......do i need to add this 127.0.0.1 ip or my mail server ip???? And in the general tab also i have added my system IP in the IP textbox. the following is the code i have added in my sned button click event.
SmtpMail.SmtpServer = ConfigurationSettings.AppSettings("SmtpServer")
SmtpMail.SmtpServer.Insert(0, "127.0.0.1")
SmtpMail.Send("suguna.r@tcs.com", "suguna.r@tcs.com", "test", "test")
Response.Write("sent")
If the above code is used, then the page doesnt shows any error....and the mail is also not sent.

SmtpMail.SmtpServer = ConfigurationSettings.AppSettings("SmtpServer")
SmtpMail.SmtpServer = "172.20.33.126"
SmtpMail.Send("suguna.r@tcs.com", "suguna.r@tcs.com", "test", "test")
Response.Write("sent")
when the above code is used, 'transport failed to connect to server' error is shown.
Can anyone tell me whats the problem....where i have made the mistake???and what is the difference in both these codes?please help me....
Nov 13 '07 #1
3 1508
sugee
35
Can anyone suggest me the solution...?please?
Nov 13 '07 #2
mzmishra
390 Expert 256MB
Is your SMTP server address is correct.
Try the below code
MailMessage m = new MailMessage();
m.To = sendTo_;
m.From = from_;
m.BodyFormat = MailFormat.Html;
m.Body = htmlBody_;
m.Subject = subject_;
SmtpMail.SmtpServer = "your server";
SmtpMail.Send(m);
Nov 13 '07 #3
sugee
35
yes its right.....it is 172.20.33.126
then what would be the problem??
Nov 13 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
40
by: ian | last post by:
Hi, I'm a newbie (oh no I can here you say.... another one...) How can I get Python to send emails using the default windows email client (eg outlook express)? I thought I could just do the...
0
by: David Burson | last post by:
Hi, I have a VB.NET windows app that needs to automatically send a simple text email when my users run a new version of the app for the first time. I thought this would be simple, but after...
9
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
3
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
8
by: shapper | last post by:
Hello, I am trying to send an email using Asp.Net 2.0. I am getting the following error: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: No such...
9
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
2
by: Malli mindwave | last post by:
Hi, We are using the yahoowebHostiing service for my company website, In that one screen of the SendComments/FeedBack section is there, I'm basically dot.net develeoper ,but yahoowebhosting not...
5
by: Mike | last post by:
I have a page with a textbox that a user can enter in mutliple email addresses such as: user1@yahoo.com;user2@yahoo.com;user3@gmail.com; and so on, I then have a foreach loop to get all of the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.