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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by query string?

1006


hi .net gurus. plz if any one has dumps on 70-631 and 70-541 on windows sharepoint services kindly mail me.

1705


a web application needs to be created to accept the product name and quantity of a toy from a customer. After the customer has entered the product name the application needs to display the discounted price of the product to the customer (company is offering 35% discount on all products). The application should allow the customer to select the product name from a list box. and also while i'm data binding to a label with custom data binding with some declarations : "The Discounted Price is "+((System.Convert.todouble(lblprodprice.text)*(system.convert.todouble(txtqty.text)) - ((System.convert.todouble(lblprodprice.text)*(system.convert.todouble(txtqty.text)*0.35)). Where i need to give this declaration in asp.net 2.0.

1880