Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How do I send an email message from my ASP.NET page?



How do I send an email message from my ASP.NET page?..

Answer / Sumeet Bhatnagar

To send an email message from an ASP.NET page, you can use the System.Net.Mail namespace. Here's a simple example:

using System.Net;
using System.Net.Mail;

MailMessage mail = new MailMessage();
SmtpClient Client = new SmtpClient();

mail.From = new MailAddress("yourEmail@example.com");
mail.To.Add("recipientEmail@example.com");
mail.Subject = "Test Email";
mail.Body = "This is a test email sent from ASP.NET.";

Client.Port = 25;
Client.DeliveryMethod = SmtpDeliveryMethod.Network;
Client.UseDefaultCredentials = false;
Client.Host = "smtp.example.com";
Client.EnableSsl = true;
Client.Send(mail);

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

What is the difference between ExecuteReader,ExecuteNonQuery and ExecuteScalar.

8 Answers  


What is the use of The Page.Master Property?

1 Answers  


What is cross page posting? How is it done?

1 Answers  


What are the types of session in asp.net?

1 Answers  


Anyone has Latest Microsoft ASP.NET Certification Dumps for these?

1 Answers  


Explain the difference between singleton and single call?

1 Answers  


What is server objects in asp.net?

5 Answers  


asp.net interview questions

0 Answers  


After capturing the SelectIndexChanged event for a ListBox Control, you find that the event handler doesn?t execute. What could be the problem be? a) The AutoEventWireup attribute is set to False b) The AutomaticPostBack attribute is set to False c) The codebehind module is not properly compiled d) The ListBox must be defined WithEvents.

2 Answers   Syntax Softtech,


Explain current thinking around IClonable.

1 Answers   Infosys, Wipro,


What is difference between viewstate and session in asp net?

1 Answers  


What is s2s tracking?

1 Answers  


Categories