Asp And Email

This is a discussion on "Asp And Email" within the Classic ASP section. This forum, and the thread "Asp And Email are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 1st, 2007, 09:06
New Member
Join Date: Aug 2007
Location: UK
Age: 26
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Asp And Email

Hello everyone,

I am very new to asp and coding in general. I have been tasked with creating web forms to allow feedback for our site and with google have got as far as creating a form which passes 4 simple text inputs to email.asp which does indeed send the email (using CDOSYS, dunno much about that either) I am a bit stuck though. here is what I have so far:
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Feedback"
myMail.From= (Request.Form("email"))
myMail.To="me@mydomain"
myMail.HTMLBody = (Request.Form("comments"))

I would like the main body of the email I recieve to be formatted like this:

User: username
email: user@adomain.com
Comments: The user cvomments
Date: The date of thier visit

Currently I get the comments in the main body and nothing else. Im new, so be gentle.
Thanks in advance for any replies.
Reply With Quote

  #2 (permalink)  
Old Aug 1st, 2007, 09:12
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,953
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Re: Asp And Email

Hope this helps...

You may need to tweak it to match your mail forms, but it should be pretty close.

Code: Select all
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Feedback"
myMail.From= (Request.Form("email"))
myMail.To="me@mydomain"

MyBody = "User: " & request.form("User") & "<br />"
MyBody = Mybody & "Email: <a href=""mailto:" & request.form("email") & """>" & request.form("email") & "<br />"
MyBody = MyBody & "Comments: " & replace(request.form("Comments"),vbcrlf,"<br />") & "<br /><br />"
MyBody = MyBody & "Date: " & FormatDateTime(now,1)
myMail.HTMLBody = MyBody
myMail.Send
set myMail=nothing
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #3 (permalink)  
Old Aug 1st, 2007, 09:39
New Member
Join Date: Aug 2007
Location: UK
Age: 26
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Asp And Email

Rob,

you da man. I have a new found interest and will defo be keeping an eye on these forums. Theres a lot for me to learn here, obviously !!!
Reply With Quote
Reply

Tags
a tag

Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
email jasonjkd Web Page Design 9 Nov 12th, 2007 22:36
PHP email form not sending email Kurt PHP Forum 1 Oct 12th, 2007 04:26
Form submits to email via php, but email is blank!!?? DH1234 PHP Forum 2 Jun 18th, 2007 10:42
PHP Email Sabin_33 PHP Forum 7 Dec 22nd, 2006 15:28


All times are GMT. The time now is 07:38.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43