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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Quotes" in non-MIME email

Status
Not open for further replies.

AndyatIES

Technical User
Jul 4, 2002
18
GB
I'm using a form to send emails from my sites. Simple stuff: name, sender's email, etc. plus message textarea.

I use the PHP mail() facility so the message goes as a string in a variable.

Can I prevent quotes in the user's text coming through as escaped characters, eg:

I like your "email" facility ==> I like your \"email\" facility

or is this a feature I can't avoid without going (presumably) to MIME?
 
I believe sleiplnir is correct. I have used stripslashes() in the same scenario:

Code:
  $to = &quot;$toname <$toemail>&quot;;
       
  /* the message */
  $message .= stripslashes($body);

  /* the subject */
  $subject = &quot;$subj&quot;;
      
  /* the headers */  
  $headers = &quot;From: $name <$email>&quot;;
       
  /* and now for mailling it */
  mail ($to, $subject, $message, $headers)
--
Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top