sending Email in C#
-
anyone over there please help I was trying sending Email in C# the code goes this way... string smtp = "localhost"; System.Net.Mail.SmtpClient smtpClient = new System.Net.Mail.SmtpClient(smtp); System.Net.Mail.MailMessage objEmail = new System.Net.Mail.MailMessage(); objEmail.To.Add(txtEmail.Text); //to@domain.com objEmail.From = new System.Net.Mail.MailAddress(txtFrom.Text, "kv"); //from@domain.com objEmail.Subject = "Test Email For DOT NET"; objEmail.Body = txtMessage.Text; //some body objEmail.Priority = System.Net.Mail.MailPriority.High; //SmtpMail.SmtpServer = "localhost"; try { smtpClient.Send(objEmail); Response.Write("Your Email has been sent sucessfully -Thank You"); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } ----but my doubt is When the code is run I am getting a message "Your Email has been sent sucessfully -Thank You" but when checked the mail I don't find the mail sent in inbox. I am using localhost as SMTP server . May please help me in this . Also I have configured the SMTP server to 127.0.0.1 (AdminTools->IIS->Default SMTP Virtual Server->properties->access->relay->127.0.0.1). I found the SMTP working in my system.But the mail can't be found in the Inbox of the recepient(it's my own mail) :rose: Thanking in advance :rose:
Kovuru Sreedhar
-
anyone over there please help I was trying sending Email in C# the code goes this way... string smtp = "localhost"; System.Net.Mail.SmtpClient smtpClient = new System.Net.Mail.SmtpClient(smtp); System.Net.Mail.MailMessage objEmail = new System.Net.Mail.MailMessage(); objEmail.To.Add(txtEmail.Text); //to@domain.com objEmail.From = new System.Net.Mail.MailAddress(txtFrom.Text, "kv"); //from@domain.com objEmail.Subject = "Test Email For DOT NET"; objEmail.Body = txtMessage.Text; //some body objEmail.Priority = System.Net.Mail.MailPriority.High; //SmtpMail.SmtpServer = "localhost"; try { smtpClient.Send(objEmail); Response.Write("Your Email has been sent sucessfully -Thank You"); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } ----but my doubt is When the code is run I am getting a message "Your Email has been sent sucessfully -Thank You" but when checked the mail I don't find the mail sent in inbox. I am using localhost as SMTP server . May please help me in this . Also I have configured the SMTP server to 127.0.0.1 (AdminTools->IIS->Default SMTP Virtual Server->properties->access->relay->127.0.0.1). I found the SMTP working in my system.But the mail can't be found in the Inbox of the recepient(it's my own mail) :rose: Thanking in advance :rose:
Kovuru Sreedhar
Have you checked in the spam/bulk ?
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
anyone over there please help I was trying sending Email in C# the code goes this way... string smtp = "localhost"; System.Net.Mail.SmtpClient smtpClient = new System.Net.Mail.SmtpClient(smtp); System.Net.Mail.MailMessage objEmail = new System.Net.Mail.MailMessage(); objEmail.To.Add(txtEmail.Text); //to@domain.com objEmail.From = new System.Net.Mail.MailAddress(txtFrom.Text, "kv"); //from@domain.com objEmail.Subject = "Test Email For DOT NET"; objEmail.Body = txtMessage.Text; //some body objEmail.Priority = System.Net.Mail.MailPriority.High; //SmtpMail.SmtpServer = "localhost"; try { smtpClient.Send(objEmail); Response.Write("Your Email has been sent sucessfully -Thank You"); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } ----but my doubt is When the code is run I am getting a message "Your Email has been sent sucessfully -Thank You" but when checked the mail I don't find the mail sent in inbox. I am using localhost as SMTP server . May please help me in this . Also I have configured the SMTP server to 127.0.0.1 (AdminTools->IIS->Default SMTP Virtual Server->properties->access->relay->127.0.0.1). I found the SMTP working in my system.But the mail can't be found in the Inbox of the recepient(it's my own mail) :rose: Thanking in advance :rose:
Kovuru Sreedhar
-
Have you checked in the spam/bulk ?
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
yes I did checked in spam/bulk also. bye the bye please tell me what does this mean and why "All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems" in the beginning means where to write the code ,is it load event?
Kovuru Sreedhar
-
yes I did checked in spam/bulk also. bye the bye please tell me what does this mean and why "All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems" in the beginning means where to write the code ,is it load event?
Kovuru Sreedhar
-
Try sending the e-mail to a different account, it could be that your current account is blocking the e-mail. Also try hardcoding your e-mail address in the to box to test
tried it but the same result . i even hard coded the mail address
Kovuru Sreedhar
-
yes I did checked in spam/bulk also. bye the bye please tell me what does this mean and why "All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems" in the beginning means where to write the code ,is it load event?
Kovuru Sreedhar
kvsreedhar wrote:
bye the bye please tell me what does this mean
By the way... ;P
kvsreedhar wrote:
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems
I really do not know what adjective to use for you. In between, that was a joke. :-D
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
kvsreedhar wrote:
All C# applications should call Application.Quit();
I dont think he like c#
literally I don't understand ur words . if u have ans to Application.Quit() pl. tell me.
Kovuru Sreedhar
-
literally I don't understand ur words . if u have ans to Application.Quit() pl. tell me.
Kovuru Sreedhar
-
kvsreedhar wrote:
bye the bye please tell me what does this mean
By the way... ;P
kvsreedhar wrote:
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems
I really do not know what adjective to use for you. In between, that was a joke. :-D
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
I would be more happy with your answer for Application.quit() :)
Kovuru Sreedhar
-
:laugh: really I laughed on My Ignorance of the subject(App.Quit()). :laugh: Any how please help me with email .
Kovuru Sreedhar
-
:laugh: really I laughed on My Ignorance of the subject(App.Quit()). :laugh: Any how please help me with email .
Kovuru Sreedhar
I suggest you create a simple page and just use the code from this site to test. Try using different e-mail address as well with this code http://www.aspheute.com/english/20000918.asp
-
kvsreedhar wrote:
bye the bye please tell me what does this mean
By the way... ;P
kvsreedhar wrote:
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems
I really do not know what adjective to use for you. In between, that was a joke. :-D
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
Looks like I have to put a joke smiley next to my sig
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
Looks like I have to put a joke smiley next to my sig
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
N a v a n e e t h wrote:
Looks like I have to put a joke smiley next to my sig
Well, actually not. You rarely get to see these type of icons :laugh:
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
N a v a n e e t h wrote:
Looks like I have to put a joke smiley next to my sig
Well, actually not. You rarely get to see these type of icons :laugh:
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
:) you are Too Smart MB :)
Kovuru Sreedhar