Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send email with Subject line 2

Status
Not open for further replies.

scc

Programmer
Apr 30, 2001
218
US
I would like to have a mailto link that will initiate a new email, and would like to pass in the subject line using data from a input box that the user entered, along with some text in the body of the email.

Using html I can call up the new email with the sent to line completed:

<A HREF=mailto:someone@work.com>someone@workcom</A>

but want to pass in the subject and part of the message too.

Is this something Javascript can do, and if so how? If not, can someone point me in the right direction where to find info on this?

TIA!
 
Works beautifully!!!! Thanks a bunch.
 
Okay, what if I need to force a newline in the body of the email, is there a command to do that?
 
I am using ASP with VBScript server-side and Javascript client-side for validation (all of which I'm new to).

Just want to put three short lines in the body of the email, but have it in a format that is easily read:

Name:xxxxxxxxxx
SSN: xxxxxxxxxx
DOB: xxxxxxxxxx

where xxx's hold data that the user entered in the form.

 
You could use ASP to build these emails from the form data. Something like this - your webserver needs to be configured to be able to send emails - SMTP service should be enough.

Code:
strFile = &quot;c:\temp\somefile.doc&quot;

strBody = &quot;Name: &quot; & Request.Form(&quot;Name&quot;) & &quot;<BR>&quot; & _
          &quot;SSN: &quot; & Request.Form(&quot;SSN&quot;) & &quot;<BR>&quot; & _
          &quot;DOB: &quot; & Request.Form(&quot;DOB&quot;) & &quot;<BR>&quot; & _
          &quot;add any remaining content&quot;

Set objNewMail = CreateObject(&quot;CDONTS.NewMail&quot;)

objMewMail.MailFormat = 0
objNewMail.From = &quot;fromaddress@somewhere.com&quot;
objNewMail.To = Request.Form(&quot;email&quot;)
objNewMail.Cc = &quot;ccaddress@somewhere.com&quot;
objNewMail.Bcc = &quot;bccaddress@somewhere.com&quot;
objNewMail.Subject = &quot;This is your subject&quot;
objNewMail.Body = strBody
objNewMail.AttachFile strFile, &quot;Attachment Description&quot;

objNewMail.Send

Set objNewMail = Nothing
Tony
 
scc,

you can use %0D or %0A to make a line break:

<A HREF=mailto:someone@work.com?subject=my subject&body=line one%0Aline two%0Aline three>someone@workcom</A>
======================================

if (!succeed) try();
-jeff
 
Great! That was exactly what I needed.

It would be nice to know the command for inserting a tab, and how I could change the font...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top