Can we send a mail using asp.net without the server???
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manikavelu VelayuthamRank #413 · 6K reputationPosted Dec 22, 2010, 9:24 PM EST
Krishna GaradRank #191 · 12.8K reputationPosted Dec 22, 2010, 9:30 PM EST
prajwal kp11 reputationPosted Dec 22, 2010, 10:06 PM EST
Soft CornerRank #1,221 · 1.5K reputationPosted Dec 22, 2010, 10:37 PM EST
Take this one example of Console application :-
Note In visual Studio 2005, you do not have to click Select.
using System;
using System.Web.Mail;
namespace WebMail
{
class Class1
{
static void Main(string[] args)
{
try
{
MailMessage oMsg = new MailMessage();
// TODO: Replace with sender e-mail address.
oMsg.From = "[email protected]";
// TODO: Replace with recipient e-mail address.
oMsg.To = "[email protected]";
oMsg.Subject = "Send Using Web Mail";
// SEND IN HTML FORMAT (comment this line to send plain text).
oMsg.BodyFormat = MailFormat.Html;
// HTML Body (remove HTML tags for plain text).
oMsg.Body = "Hello World!";
// ADD AN ATTACHMENT.
// TODO: Replace with path to attachment.
String sFile = @"C:\temp\Hello.txt";
MailAttachment oAttch = new MailAttachment(sFile, MailEncoding.Base64);
oMsg.Attachments.Add(oAttch);
// TODO: Replace with the name of your remote SMTP server.
SmtpMail.SmtpServer = "MySMTPServer";
SmtpMail.Send(oMsg);
oMsg = null;
oAttch = null;
}
catch (Exception e)
{
Console.WriteLine("{0} Exception caught.", e);
}
}
}
}
//Modify the code where you see "TODO".
Hope this will help you :)
Sam HobbsRank #107 · 20.5K reputationPosted Dec 22, 2010, 10:39 PM EST
prajwal kp11 reputationPosted Dec 22, 2010, 10:41 PM EST
Krishna GaradRank #191 · 12.8K reputationPosted Dec 22, 2010, 11:07 PM EST
Soft CornerRank #1,221 · 1.5K reputationPosted Dec 22, 2010, 11:07 PM EST
Sam HobbsRank #107 · 20.5K reputationPosted Dec 22, 2010, 11:30 PM EST
Krishna GaradRank #191 · 12.8K reputationPosted Dec 22, 2010, 11:37 PM EST
Soft CornerRank #1,221 · 1.5K reputationPosted Dec 22, 2010, 11:40 PM EST
http://www.c-sharpcorner.com/UploadFile/prathore/emailSending01052009031339AM/emailSending.aspx
http://www.c-sharpcorner.com/UploadFile/anjudidi/SendMultipleEmail09092009013702AM/SendMultipleEmail.aspx
prajwal kp11 reputationPosted Dec 23, 2010, 1:08 AM EST
Soft CornerRank #1,221 · 1.5K reputationPosted Dec 23, 2010, 1:46 AM EST
go thro' this link u will findout one library Indy.Sockets which is useful for receiving mail in asp.net
http://www.codeproject.com/KB/IP/POP3ClientByChadZHower.aspx
( if ur using gmail then might need to do some settings also in gmail
settings->Forwarding & POP/IMAP -> enable POP for all mail & enable IMAP )
Sam HobbsRank #107 · 20.5K reputationPosted Dec 23, 2010, 1:50 AM EST
Suthish NairRank #92 · 22.8K reputationPosted Dec 23, 2010, 7:51 AM EST
check our Our recommended articles section, right side of window.