How do I send e-mail from an ASP.NET application ?
Answer / kumar saurabh
MailMessage message = new MailMessage ();
message.From = <email>;
message.To = <email>;
message.Subject = "Scheduled Power Outage";
message.Body = "Our servers will be down tonight.";
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send (message);
MailMessage and SmtpMail are classes defined in the .NET Framework Class Library's System.Web.Mail namespace. Due to a security change made to ASP.NET just before it shipped, you need to set SmtpMail's SmtpServer property to "localhost" even though "localhost" is the default. In addition, you must use the IIS configuration applet to enable localhost (127.0.0.1) to relay messages through the local SMTP service.
| Is This Answer Correct ? | 0 Yes | 0 No |
I need some questions regarding asp.net for 1.5yrs of Experience.
in database table is thier . in that table fields are photoid , photoname,photo... i want display image in the gridview
What is the biggest disadvantage of “Other Return Types” in Web API?
Explain the differences between Server-side and Client-side code?
12 Answers Cognizant, CTS, Siebel Systems, Visual Soft,
I have got less marks in bsc it So how to get interview.tell me
what is wpf and wcf in .net explain with an example?
Is asp.net outdated?
How can you pass multiple complex types in Web API?
what are the State management and Its Uses
Is it possible to prevent a browser from caching an ASPX page?
How do you trap errors in ASP and how do you invoke a component in ASP ?
How do you create a master page?
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)