If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > can any body do this ??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-06-06, 07:16
handshakeit handshakeit is offline
Registered User
 
Join Date: Oct 2005
Posts: 2
Question can any body do this ??

Hi All,

I want to create a simple .net page which has 2 text boxes one 4 subject n other 4 message

and a send button

when we click to send button this message should be send to my particular mail id.

can any body tell me which classes and objects will be used in it’s code’……..

Thanx in advance

Devs
Reply With Quote
  #2 (permalink)  
Old 02-07-06, 03:37
sandhya_pn sandhya_pn is offline
Registered User
 
Join Date: Feb 2006
Posts: 5
imports System.Web.Mail

In the Click event of the button, write the following code.

Dim mailMsg as New MailMessage()

mailMsg .To = "abcdef@pqr.com"
mailMsg .Cc = "xyz@lmn.com"
mailMsg .From = "rst@def.com"
mailMsg .Subject = txtSubject.text
mailMsg.Body = txtBody.text

SmtpMail.Send(mailMsg)

Email messages can be either plain text or HTML.
Default is "plain text".
The BodyFormat property could be set as Html to send the mail in HTML format.

mailMsg.BodyFormat = MailFormat.Html
-----------------------------------------------------------------------
Note:
Classes used
SMTPMail and MailMessage

Please check whether your Microsoft SMTP Service is turned on
before you create applications to send mails
else the mails would never be sent.

Goto
Internet Information Services -> Default SMTP Virtual Server
Check if the 'play' button is disabled, if yes,it is already started
else start it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On