473,587 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2216
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.c om"

'The subject of the email
email.Subject = "UtilMailMessag e001"

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

'The format of the contents of the email
'The email format can either be MailFormat.Html or MailFormat.Text
'MailFormat.Htm l : Html Content
'MailFormat.Tex t : Text Message
email.BodyForma t = MailFormat.Html

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

'The name of the smtp server to use for sending emails
'SmtpMail.SmtpS erver is commonly ignored in many applications
SmtpMail.SmtpSe rver = "Mail.NoSpamSer ver.com"

'Send the email and handle any error that occurs
Try
SmtpMail.Send(e mail)
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******** ******@TK2MSFTN GP09.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*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.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.c om"

'The subject of the email
email.Subject = "UtilMailMessag e001"

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

'The format of the contents of the email
'The email format can either be MailFormat.Html or MailFormat.Text
'MailFormat.Htm l : Html Content
'MailFormat.Tex t : Text Message
email.BodyForma t = MailFormat.Html

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

'The name of the smtp server to use for sending emails
'SmtpMail.SmtpS erver is commonly ignored in many applications
SmtpMail.SmtpSe rver = "Mail.NoSpamSer ver.com"

'Send the email and handle any error that occurs
Try
SmtpMail.Send(e mail)
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******** ******@TK2MSFTN GP09.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******** ******@TK2MSFTN GP09.phx.gbl...
Thanks. Does this service come with W2K professional? That is what my web
server is.

"Ruslan Shlain" <rs*****@hotmai l.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.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.c om"

'The subject of the email
email.Subject = "UtilMailMessag e001"

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

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

'MailFormat.Htm l : Html Content
'MailFormat.Tex t : Text Message
email.BodyForma t = MailFormat.Html

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

'The name of the smtp server to use for sending emails
'SmtpMail.SmtpS erver is commonly ignored in many applications
SmtpMail.SmtpSe rver = "Mail.NoSpamSer ver.com"

'Send the email and handle any error that occurs
Try
SmtpMail.Send(e mail)
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******** ******@TK2MSFTN GP09.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
1788
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 loop, it updates the SENT field of the processed row to mark it sent. I have a sleep function in there to slow the processing down to see if that alleviated the following problem - it did help. What is happening is the first 20 emails it sends...
10
4957
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 working with we put these mailshots in the bcc field of the mails. This can sometimes cause a problem as we are getting alot of mails bounced back. I would like to write a script to have these emails sent out individually using the to: field of the...
2
9215
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 - I see hebrew, it is just sending by myself using *.aspx scripts). In web.config I have the following : <configuration> <system.web>
1
1758
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 sent an encrypted email using SHA1 from a WebForm. What kind of software should a user have on his/her desktop to decrypt this message?
1
1078
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 sample code (VB.NET). I would like to know if it is possible to use HTML to format the emails as opposed to just text, i.e. use a picture for the header, specify fonts, bold text, center text etc. all from information stored in a database. Any...
2
1276
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 sample code (VB.NET). I would like to know if it is possible to use HTML to format the emails as opposed to just text, i.e. use a picture for the header, specify fonts, bold text, center text etc. all from information stored in a database. Any...
4
2081
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 time. The emails are in the user database for the website. It's used for sending group notices and passwords to the members. I'm currently using CDONTS - which works ok - although it is very slow to send 500 emails. (each email is customized...
5
23790
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 = 'xxxx@xxxx.xxxx.edu'
0
1016
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 the form and appends it to an email which it then sends out to one specific user (for testing purposes, it's sending to me). My problem is that the code somehow is sending two identical emails to me. I am almost certain that the code looks ok,...
0
7854
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8219
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7978
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8221
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6629
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.