.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 15th, 2005, 11:52 PM
NinaWilliam NinaWilliam is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: @Home :D
Posts: 50 NinaWilliam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 50 m 31 sec
Reputation Power: 0
Smile How to send emails from ASP.NET page??

Hi,

Can anyone show me how can i send an email from an ASP.NET page, please??

Thank you

ASP.NET/VB.NET

Reply With Quote
  #2  
Old June 21st, 2005, 04:59 PM
zombie_man23 zombie_man23 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 22 zombie_man23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 16 m
Reputation Power: 0
The first line in the subroutine creates a MailMessage object. This object is available because we have included a reference to the "System.Web.Mail" namespace. This object basically mirrors the options of a standard email message, so the naming is very intuitive. Set the properties of the new MailMessage object based on the values from the form variables. Once the properties are set, we only need to call SmtpMail.Send to execute the delivery of the mail message.


import System.Web.Mail


Sub SendMail (Obj As Object, E As EventArgs)

Dim mailObj AS new MailMessage

mailObj.From = MsgFrom.text
mailObj.To = MsgTo.Text
mailObj.Subject = MsgSubject.Text
mailObj.Body = MsgBody.Text

SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(mailObj)
End Sub

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > How to send emails from ASP.NET page??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT