Bluehost.com Web Hosting $6.95

Re: [PHP] two small issues with php mail

This is a discussion on Re: [PHP] two small issues with php mail within the PHP General forums, part of the PHP Programming Forums category; Brad wrote: > Implementing Bcc and smtp. > > > > #1 email is only being sent to a few ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-19-2007
Jim Lucas
 
Posts: n/a
Default Re: [PHP] two small issues with php mail

Brad wrote:
> Implementing Bcc and smtp.
>
>
>
> #1 email is only being sent to a few recipients.
>
> I need to implement
>
> $smtp = ‘localhost’;


if the previous line is a cut/paste, it looks like you are using M$ special quotes or back tics maybe.

make sure they are single or double quotes and you should be good to go.

>
> Somewhere, but I keep getting parse errors?
>
>
>
> #2 trying to do a Bcc but that gives me parse errors as well
>
> It should be as easy as?
>
> $Bcc ‘some@address.org’; $eol = "\r\n";
>
>
>
> Here is the working code, but if I implement the above needed inserts
> anywhere, I get a big ‘ol fat parse error
>
>
>
> Any assistance would be truly appreciated.
>
> An explanation of why would really help since this is for a school project.
>
>
>
> Working code as is:
>
>
>
> <?
>
> $email = $_REQUEST['email'];
>
> $fromaddress = 'admin@zoneofsuccessclub.com';
>
> $fromname = 'Zone of success Club'; $eol = "\r\n";
>
> $headers = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
>
> // $headers = 'bcc: 'kathyandrews@bellsouth.net';

You have an extra single quote in the previous line. Hence your parse error.

>
> $headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
>
> $headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
>
> $headers .= 'X-Mailer: PHP '.phpversion().$eol;
>
> $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
>
> $headers .= 'Content-Transfer-Encoding: 8bit';
>
> $subject = 'Your free book!';
>
> $body = '<a
> href="http://www.zoneofsuccessclub.com/freePDF/autopilotebook.pdf">"Click
> ME"</a> Here is your FREE autopilot book!!!!';
>
> mail($email, $subject, $body, $headers);
>
> ?>
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
> 5:15 PM
>
>



--
Jim Lucas

"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare
Reply With Quote
  #2 (permalink)  
Old 11-19-2007
Brad
 
Posts: n/a
Default RE: [PHP] two small issues with php mail

$headers = 'bcc: kathyandrews@bellsouth.net';

Works but corrupts the "from" portion and changes it to "nobody"
Which I think goes back too the smtp portion.
Let me try that!

Thank you!

-----Original Message-----
From: Jim Lucas [mailto:lists@cmsws.com]
Sent: Monday, November 19, 2007 12:49 PM
To: Brad
Cc: php-general@lists.php.net
Subject: Re: [php] two small issues with php mail

Brad wrote:
> Implementing Bcc and smtp.
>
>
>
> #1 email is only being sent to a few recipients.
>
> I need to implement
>
> $smtp = ‘localhost’;


if the previous line is a cut/paste, it looks like you are using M$ special
quotes or back tics maybe.

make sure they are single or double quotes and you should be good to go.

>
> Somewhere, but I keep getting parse errors?
>
>
>
> #2 trying to do a Bcc but that gives me parse errors as well
>
> It should be as easy as?
>
> $Bcc ‘some@address.org’; $eol = "\r\n";
>
>
>
> Here is the working code, but if I implement the above needed inserts
> anywhere, I get a big ‘ol fat parse error
>
>
>
> Any assistance would be truly appreciated.
>
> An explanation of why would really help since this is for a school

project.
>
>
>
> Working code as is:
>
>
>
> <?
>
> $email = $_REQUEST['email'];
>
> $fromaddress = 'admin@zoneofsuccessclub.com';
>
> $fromname = 'Zone of success Club'; $eol = "\r\n";
>
> $headers = 'From: '.$fromname.' <'.$fromaddress.'>'.$eol;
>
> // $headers = 'bcc: 'kathyandrews@bellsouth.net';

You have an extra single quote in the previous line. Hence your parse
error.

>
> $headers .= 'Reply-To: '.$fromname.' <'.$fromaddress.'>'.$eol;
>
> $headers .= 'Return-Path: '.$fromname.' <'.$fromaddress.'>'.$eol;
>
> $headers .= 'X-Mailer: PHP '.phpversion().$eol;
>
> $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
>
> $headers .= 'Content-Transfer-Encoding: 8bit';
>
> $subject = 'Your free book!';
>
> $body = '<a
> href="http://www.zoneofsuccessclub.com/freePDF/autopilotebook.pdf">"Click
> ME"</a> Here is your FREE autopilot book!!!!';
>
> mail($email, $subject, $body, $headers);
>
> ?>
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date:

11/18/2007
> 5:15 PM
>
>



--
Jim Lucas

"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007
5:15 PM

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:05 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0