HELP ** How to create a e-mail threding page

Results 1 to 3 of 3

Thread: HELP ** How to create a e-mail threding page

  1. #1
    Join Date
    Dec 1969
    Posts
    71

    Default HELP ** How to create a e-mail threding page

    Hi, <BR><BR>Can you please help me to do a asp script just the one used in this form?<BR><BR>Please help<BR><BR>Jude

  2. #2
    Join Date
    Dec 1969
    Posts
    181

    Default RE: HELP ** How to create a e-mail threding page

    It&#039s a little tricky. Mail me.<BR>makrn@wmdata.com<BR><BR>

  3. #3
    Arif Virk Guest

    Default RE: HELP ** How to create a e-mail threding page

    If you understand VBScript,the following might help you :-<BR><BR>&#060;%<BR>Dim strTo, strSubject, strBody &#039Strings for recipient, subject, boby<BR>Dim objCDOMail &#039The CDO object<BR><BR><BR>&#039First we&#039ll read in the values entered<BR>strTo = Request.Form("to")<BR><BR>&#039These would read the message subject and body if we let you enter it<BR>&#039strSubject = Request.Form("subject")<BR>&#039strBody = Request.Form("body")<BR><BR>strSubject = "Sample E-mail sent from ASP 101!"<BR><BR>&#039 This is multi-lined simply for readability<BR>strBody = "This message was sent from a sample at http://www.asp101.com. "<BR>strBody = strBody & "It is used to show people how to send e-mail from an "<BR>strBody = strBody & "Active Server Page. If you did not request this "<BR>strBody = strBody & "e-mail yourself, your address was entered by one of "<BR>strBody = strBody & "our visitors. We do not store these e-mail addresses."<BR>strBody = strBody & " Please address all concerns to webmaster@asp101.com."<BR><BR>&#039Ok we&#039ve got the values now on to the point of the script.<BR><BR>&#039We just check to see if someone has entered anything into the to field.<BR>&#039If it&#039s equal to nothing we show the form, otherwise we send the message.<BR>&#039If you were doing this for real you might want to check other fields too<BR>&#039and do a little entry validation like checking for valid syntax etc.<BR>If strTo = "" Then<BR> %&#062;<BR> &#060;FORM ACTION="./email_cdo.asp" METHOD="post"&#062;<BR> Enter your e-mail address:<BR><BR> &#060;INPUT TYPE="text" NAME="to" SIZE="30"&#062;&#060;/INPUT&#062;<BR><BR> &#060;!-- These would be used if we decided to let you edit them<BR> Subject:&nbsp;<BR> &#060;INPUT TYPE="text" NAME="subject" SIZE="30"&#062;&#060;/INPUT&#062;<BR><BR> <BR> Message:&nbsp;<BR> &#060;TEXTAREA NAME="body" ROWS="10" COLS="40" WRAP="virtual"&#062;&#060;/TEXTAREA&#062;<BR><BR> --&#062;<BR><BR> &#060;INPUT TYPE="submit" VALUE="Send Mail!"&#062;&#060;/INPUT&#062;<BR> &#060;/FORM&#062;<BR> &#060;%<BR>Else<BR> &#039 Create an instance of the NewMail object.<BR> Set objCDOMail = Server.CreateObject("CDONTS.NewMail")<BR> <BR> &#039 Set the properties of the object<BR> objCDOMail.From = "webmaster@asp101.com"<BR> objCDOMail.To = strTo<BR> objCDOMail.Subject = strSubject<BR> objCDOMail.Body = strBody<BR><BR> &#039 There are lots of other properties you can use.<BR> &#039 You can send HTML e-mail, attachments, etc...<BR> &#039 You can also modify most aspects of the message<BR> &#039 like importance, custom headers, ...<BR> &#039 Check the documentation for a full list as well<BR> &#039 as the correct syntax.<BR><BR> &#039 Some of the more useful ones I&#039ve included samples of here:<BR> &#039objCDOMail.Cc = "john@asp101.com;gary@asp101.com"<BR> &#039objCDOMail.Bcc = "john@asp101.com;gary@asp101.com"<BR> &#039objCDOMail.Importance = 1 &#039(0=Low, 1=Normal, 2=High)<BR> &#039objCDOMail.AttachFile "c:pathfilename.txt", "filename.txt"<BR><BR> &#039 Send the message!<BR> objCDOMail.Send<BR> <BR> &#039 Set the object to nothing because it immediately becomes<BR> &#039 invalid after calling the Send method.<BR> Set objCDOMail = Nothing<BR><BR> Response.Write "Message sent to " & strTo & "!"<BR>End If<BR>%&#062;<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •