472,952 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 software developers and data experts.

HELP: Sending Emails From Webform

My company has it's own webserver, which is going to host our ASP.NET web
application. We want the website to be able to send out emails.

1. What do I need on the server so that it has the abillity to send out
emails? It is a Windows 2000 Professional SP3 server.
2. Any examples (code, etc...) on how to send out emails via an ASP.NET
webform?

Thanks!
Nov 18 '05 #1
3 2152
Not too worry.
Its very easy.
First make syre you have SMPT server /Services running on your web server.

As far as code you can use any exemples in the books or online. see if this
will work for you

Public Function SendEmail() As Boolean

'For a Windows Forms Application, add a reference to
'System.Web.dll using [Project Add References]

Dim email As New MailMessage()

'The email address of the sender
email.From = "fr**@microsoft.com"

'The email address of the recipient.
'Seperate multiple email adresses with a comma seperator
email.To = "to@microsoft.com"

'The subject of the email
email.Subject = "UtilMailMessage001"

'The Priority attached and displayed for the email
email.Priority = MailPriority.High

'The format of the contents of the email
'The email format can either be MailFormat.Html or MailFormat.Text
'MailFormat.Html : Html Content
'MailFormat.Text : Text Message
email.BodyFormat = MailFormat.Html

'The contents of the email can be a HTML Formatted Message
email.Body = "<html><body><table><tr><td>A Star Is
Born</td></tr></table></body></html>"

'The name of the smtp server to use for sending emails
'SmtpMail.SmtpServer is commonly ignored in many applications
SmtpMail.SmtpServer = "Mail.NoSpamServer.com"

'Send the email and handle any error that occurs
Try
SmtpMail.Send(email)
Return True
Catch
Return False
End Try

End Function 'Send Email Synchronously With VB.NET, SmtpService,
MailMessage Class and System.Web.Mail Namespace

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:#J**************@TK2MSFTNGP09.phx.gbl...
My company has it's own webserver, which is going to host our ASP.NET web
application. We want the website to be able to send out emails.

1. What do I need on the server so that it has the abillity to send out
emails? It is a Windows 2000 Professional SP3 server.
2. Any examples (code, etc...) on how to send out emails via an ASP.NET
webform?

Thanks!

Nov 18 '05 #2
Thanks. Does this service come with W2K professional? That is what my web
server is.

"Ruslan Shlain" <rs*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Not too worry.
Its very easy.
First make syre you have SMPT server /Services running on your web server.

As far as code you can use any exemples in the books or online. see if this will work for you

Public Function SendEmail() As Boolean

'For a Windows Forms Application, add a reference to
'System.Web.dll using [Project Add References]

Dim email As New MailMessage()

'The email address of the sender
email.From = "fr**@microsoft.com"

'The email address of the recipient.
'Seperate multiple email adresses with a comma seperator
email.To = "to@microsoft.com"

'The subject of the email
email.Subject = "UtilMailMessage001"

'The Priority attached and displayed for the email
email.Priority = MailPriority.High

'The format of the contents of the email
'The email format can either be MailFormat.Html or MailFormat.Text
'MailFormat.Html : Html Content
'MailFormat.Text : Text Message
email.BodyFormat = MailFormat.Html

'The contents of the email can be a HTML Formatted Message
email.Body = "<html><body><table><tr><td>A Star Is
Born</td></tr></table></body></html>"

'The name of the smtp server to use for sending emails
'SmtpMail.SmtpServer is commonly ignored in many applications
SmtpMail.SmtpServer = "Mail.NoSpamServer.com"

'Send the email and handle any error that occurs
Try
SmtpMail.Send(email)
Return True
Catch
Return False
End Try

End Function 'Send Email Synchronously With VB.NET, SmtpService,
MailMessage Class and System.Web.Mail Namespace

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:#J**************@TK2MSFTNGP09.phx.gbl...
My company has it's own webserver, which is going to host our ASP.NET web application. We want the website to be able to send out emails.

1. What do I need on the server so that it has the abillity to send out
emails? It is a Windows 2000 Professional SP3 server.
2. Any examples (code, etc...) on how to send out emails via an ASP.NET
webform?

Thanks!


Nov 18 '05 #3
Yes

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:#D**************@TK2MSFTNGP09.phx.gbl...
Thanks. Does this service come with W2K professional? That is what my web
server is.

"Ruslan Shlain" <rs*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Not too worry.
Its very easy.
First make syre you have SMPT server /Services running on your web server.

As far as code you can use any exemples in the books or online. see if

this
will work for you

Public Function SendEmail() As Boolean

'For a Windows Forms Application, add a reference to
'System.Web.dll using [Project Add References]

Dim email As New MailMessage()

'The email address of the sender
email.From = "fr**@microsoft.com"

'The email address of the recipient.
'Seperate multiple email adresses with a comma seperator
email.To = "to@microsoft.com"

'The subject of the email
email.Subject = "UtilMailMessage001"

'The Priority attached and displayed for the email
email.Priority = MailPriority.High

'The format of the contents of the email
'The email format can either be MailFormat.Html or MailFormat.Text

'MailFormat.Html : Html Content
'MailFormat.Text : Text Message
email.BodyFormat = MailFormat.Html

'The contents of the email can be a HTML Formatted Message
email.Body = "<html><body><table><tr><td>A Star Is
Born</td></tr></table></body></html>"

'The name of the smtp server to use for sending emails
'SmtpMail.SmtpServer is commonly ignored in many applications
SmtpMail.SmtpServer = "Mail.NoSpamServer.com"

'Send the email and handle any error that occurs
Try
SmtpMail.Send(email)
Return True
Catch
Return False
End Try

End Function 'Send Email Synchronously With VB.NET, SmtpService,
MailMessage Class and System.Web.Mail Namespace

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:#J**************@TK2MSFTNGP09.phx.gbl...
My company has it's own webserver, which is going to host our ASP.NET

web application. We want the website to be able to send out emails.

1. What do I need on the server so that it has the abillity to send out emails? It is a Windows 2000 Professional SP3 server.
2. Any examples (code, etc...) on how to send out emails via an ASP.NET webform?

Thanks!



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: NotGiven | last post by:
The code below is designed to loop through rows of a database query obtaining email addresses and send an email to each. It is modified form fomr some code I found on the net. With each while...
10
by: Stuart Mueller | last post by:
I have an exchange server, that I sometimes use to perform mail shots to clients on our database, these can be upwards of 1000 at a time. As we don't want different clients to see who we are...
2
by: Mr. x | last post by:
Hello, I am sending emails with Hebrew contents. When receiving emails - I cannot see the Hebrew characters (it is not outlook express configuration, because when receiving emails from friends -...
1
by: Leszek | last post by:
Hello, A few weeks ago I sent a post about sending encrypted emails. I found out how to encrypt such emails using .NET, but now there is another step: How to receive them? Let's say I have...
1
by: Steven Bazeley | last post by:
I need to send a large list of emails from a webform by clicking a single button. Microsoft's documentation for coding this seems straight forward and I'm about to begin experimenting with their...
2
by: Steven Bazeley | last post by:
I need to send a large list of emails from a webform by clicking a single button. Microsoft's documentation for coding this seems straight forward and I'm about to begin experimenting with their...
4
by: MostlyH2O | last post by:
Hi Folks, I have been going in circles for weeks - trying to find the best way to send and manage emails from my ASP application. The email page might send as many as 500 individual emails at a...
5
by: Kun | last post by:
i have the following code: ---------------------------------- import smtplib from email.MIMEText import MIMEText fp = open('confirmation.txt', 'rb') msg = MIMEText(fp.read()) From =...
0
by: sheel331 | last post by:
Hello, I am new to coding in vb.net and have run into an issue with some code that I am looking over. This is a webform that is filled out and once it is filled out, it takes the responses from...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.