473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 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 2194
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.