By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,991 Members | 1,887 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,991 IT Pros & Developers. It's quick & easy.

About Sending a E-mail message ?

P: n/a
Before writing a code to send a mail using asp.net, what steps have to be taken
Like do some configuration ?
coz i'm new to .Net

your help will be appreciated.

Daniel.
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
CW
I assume you are sending emails using your IIS.

Configuration:

You need to make sure SMTP is installed on IIS. You then need to configure
SMTP server from IIS MMC to allow it to relay messages from localhost (or
the application server if your .net app is hosted on an app server). You
need to make sure CDO.dll and CDONTS.DLL are present in the
%winpath/system32% directory (and make sure you register cdonts.dll).

Code Snippet:
Dim MyMailMessage As Mail.MailMessage = New
System.Web.Mail.MailMessage()

With MyMailMessage
.From = FromAddress
.To = EmailAddress
.Subject = "Your order has been received."
.Body = "Dear Customer" & vbCrLf & vbCrLf
.Body = .Body & "Your order has been received and
entered into our web ordering system. You can view details of your order at
"
.Body = .Body & OrderURL & vbCrLf & vbCrLf & "Thank you
for your order" & vbCrLf
.Body = .Body &
System.Configuration.ConfigurationSettings.AppSett ings("ManagementName") &
vbCrLf
End With

System.Web.Mail.SmtpMail.SmtpServer =
System.Configuration.ConfigurationSettings.AppSett ings("SMTPServerAddress")
System.Web.Mail.SmtpMail.Send(MyMailMessage)
HTH

"Daniel" <an*******@discussions.microsoft.com> wrote in message
news:58**********************************@microsof t.com...
Before writing a code to send a mail using asp.net, what steps have to be taken ? Like do some configuration ??
coz i'm new to .Net.

your help will be appreciated..

Daniel.

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.