How to send mail when we are using remote SMTP server?

liunx

Guest
How to send mail when we are using remote SMTP server?

hai every one
hai i need to send some mails using SMTP server and C# i found the

following code for that purpose but only problem with it is ment for

the LOCAL SMTP server , how to handle when the SMTP server is a remote

machine in LAN and what about the authentication process.....?

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
code to send a SMTP mail for local machine
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Mail" %>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e) {
// make sure we use the local SMTP server
SmtpMail.SmtpServer = "";
// create mail message object
MailMessage oMessage = new MailMessage();
// set some properties
oMessage.BodyFormat = MailFormat.Text;
oMessage.Priority = MailPriority.High;
oMessage.From = "[email protected]";
oMessage.To = "[email protected]";
oMessage.Cc = "[email protected]";
oMessage.Bcc = "[email protected];[email protected];[email protected]";
oMessage.Subject = "Test Mail";
oMessage.Body = "This is a test e-mail, please ignore.\r\rBest

regards,\rWimdows.net";
// Send the e-mail
SmtpMail.Send(oMessage);
}
</script>
=================================================================

thanks in advance

austin
 
Back
Top