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 |
What is simple data binding?
I have prepared A Dynamic website in asp.net with c# and using Ms Sql server 2005 as backend database.i am facing problem while uploading this site on my FTP address it is not accessing the database.please could u tell me how cn i upload Sqlserver database on the web and what would be the connection string...???? I am using Server=".";initial catalog=databasename;persist security info=false;integrated security=SSPI;...pleas help me... Thanks in Advance..
What is the good practice to implement validations in aspx page?
What is view state and how this can be done and was this there in asp?
11 Answers Accenture, KDOT, Mphasis,
What is active web page?
Usage of web.config?
What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState ?
How would you get asp.net running in apache web servers?
What is the base class from which web forms are inherited?
How can you ensure a permanent cookie?
About writting a query and SP which is better ?
What are the different methods that are used during the page load?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)