How to send email in ASP.net C#

Posted by Nazirk under ASP.NET on 2/26/2009 | Views : 6435 | Status : [Member] | Replies : 5
Hi Friends,

I need your help in implementing a code in C# for sending emails from any web/windows application to any other email ids (like gmail, yahoo, rediff, hotmail,etc)

I am using localhost as my smtp server, but its not working.... neither it give me an error....nor does it sends an email.... i can see those mails queued up in "C:\Inetpub\mailroot\Queue" folder...

Plz help me out!!!

Thanks & regards
Nazir K




Responses

Posted by: perfectchourasia-9163 on: 4/3/2012 [Member] Starter | Points: 25

Up
0
Down
http://sandeep-chourasia.blogspot.in/2011/05/send-mail-in-aspnet.html

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

Nazirk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Majith on: 2/26/2009 [Member] Starter

Up
0
Down
Hi,

if you are sending mails from localhost you have to setup the Exchange Server for sending mails .

You have to install the Ms Outlook Express and configure to local system.

thanks

Nazirk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nazirk on: 2/26/2009 [Member] Starter

Up
0
Down
Hi Majith,

Well thanks for your reply, regarding my query, do you mean to say i need to configure any of my email account(gmail or yahoo or hotmail) into ms outlook. If you mean to say that then what will be their server names, will you please guide me further

thanx & regards,
Nazir K

Nazirk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Fzd.indramohan on: 3/4/2009 [Member] Starter

Up
0
Down
Nazir , basically local host is different and smtp server is different .localhsot means ur pc .

u just mention smtp server name or smtp server ip address .if ur smtp address or name is right then it send a mail

Nazirk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nazirk on: 3/4/2009 [Member] Starter

Up
0
Down
Hi Indramohan,

Ya i got your point,
now tell me if i had configured outlook to one of the mail severs (like google, hotmail, etc) and i am using "localhost" as the smtp server name in my c# code, then it will send the mail, I am right? I am sure abt this because i had tried this, but it was done when i had outlook configured to my companies email id (and hence their mail server).
Now i want to configure outlook with either gmail or hotmail and if after successfull configuration i try sending mails through c# code and using "localhost" as smtp server, then will it work?

You opinion is required, and if i am right onto this fact then will you please help me out in configuring my outlook with gmil or hotmail

thanks & regards,
nazir

Nazirk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response