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 the difference between ExecuteReader,ExecuteNonQuery and ExecuteScalar.
What is the use of The Page.Master Property?
What is cross page posting? How is it done?
What are the types of session in asp.net?
Anyone has Latest Microsoft ASP.NET Certification Dumps for these?
Explain the difference between singleton and single call?
What is server objects in asp.net?
asp.net interview questions
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.
Explain current thinking around IClonable.
What is difference between viewstate and session in asp net?
What is s2s tracking?
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)