- Previous thread: [PHP] File Upload
- Next thread: [PHP] eAccelerator Loader can't load code. Incorrect Zend Engine
- Threads sorted by date: php 201001
Hi List,
Good morning. Hope all are well on this Saturday.
I am in need of a little assistance. I am creating an HTML email.
I have created it successfully already, so I know the code works for
the HTML part.
My question is about the headers of the message.
Here is my code at the end before the message is sent off.
//other code that sets up $html and $text
if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
$eol="\r\n";
} else if (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) {
$eol="\r";
} else {
$eol="\n";
}
// To send HTML mail, the Content-type header must be set
$headers = 'From: '.$from.$eol;
$headers .= 'To: "'. $username .'" '.$eol;
//$headers .= 'Cc: ' . $from;
//$headers .= 'BCc: ' . $from;
$headers .= 'Reply-To: ' . $from .$eol;
$headers .= 'X-Mailer: PHP/' . phpversion().$eol;
$headers .= 'X-sender: '.$eol;
$headers .= 'X-receiver: '.$eol;
$headers .= 'Message-ID: '.$eol;
$headers .= 'Date: '.$time.$eol;
// Additional headers
$headers .= 'X-Priority: 1'.$eol;
$headers .= 'X-MSMail-Priority: High'.$eol;
$headers .= 'X-MimeOLE: Generated By Design Drumm - MultiPart/Alt E-
Mail'.$eol;
$headers .= 'MIME-Version: 1.0' . $eol;
$headers .= 'Content-type: multipart/alternative';
$headers .= 'boundary="'.$boundary.'"' . $eol.$eol;
// Make sure there are no bare linefeeds in the headers
//$headers = preg_replace('#(?
Good morning. Hope all are well on this Saturday.
I am in need of a little assistance. I am creating an HTML email.
I have created it successfully already, so I know the code works for
the HTML part.
My question is about the headers of the message.
Here is my code at the end before the message is sent off.
//other code that sets up $html and $text
if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
$eol="\r\n";
} else if (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) {
$eol="\r";
} else {
$eol="\n";
}
// To send HTML mail, the Content-type header must be set
$headers = 'From: '.$from.$eol;
$headers .= 'To: "'. $username .'" '.$eol;
//$headers .= 'Cc: ' . $from;
//$headers .= 'BCc: ' . $from;
$headers .= 'Reply-To: ' . $from .$eol;
$headers .= 'X-Mailer: PHP/' . phpversion().$eol;
$headers .= 'X-sender: '.$eol;
$headers .= 'X-receiver: '.$eol;
$headers .= 'Message-ID: '.$eol;
$headers .= 'Date: '.$time.$eol;
// Additional headers
$headers .= 'X-Priority: 1'.$eol;
$headers .= 'X-MSMail-Priority: High'.$eol;
$headers .= 'X-MimeOLE: Generated By Design Drumm - MultiPart/Alt E-
Mail'.$eol;
$headers .= 'MIME-Version: 1.0' . $eol;
$headers .= 'Content-type: multipart/alternative';
$headers .= 'boundary="'.$boundary.'"' . $eol.$eol;
// Make sure there are no bare linefeeds in the headers
//$headers = preg_replace('#(?
On 30 January 2010 13:04, Karl DeSaulniers wrote:
> Hi List,
> Good morning. Hope all are well on this Saturday.
> I am in =C2=A0need of a little assistance. I am creating an HTML email.
> I have created it successfully already, so I know the code works for the
> HTML part.
> My question is about the headers of the message.
>
> Here is my code at the end before the message is sent off.
>
> //other code =C2=A0that sets up $html and $text
>
> if (strtoupper(substr(PHP_OS, 0, 3) =3D=3D 'WIN')) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$eol=3D"\r\n";
> =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (strtoupper(substr(PHP_OS, 0, 3) =3D=
=3D 'MAC')) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 $eol=3D"\r";
> =C2=A0 =C2=A0 =C2=A0 =C2=A0} else {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$eol=3D"\n";
> }
>
> // To send HTML mail, the Content-type header must be set
> $headers =3D 'From: '.$from.$eol;
> $headers .=3D 'To: "'. $username .'" '.$eol;
>
> //$headers .=3D 'Cc: ' . $from;
> //$headers .=3D 'BCc: ' . $from;
> $headers .=3D 'Reply-To: ' . $from .$eol;
>
> $headers .=3D 'X-Mailer: PHP/' . phpversion().$eol;
> $headers .=3D 'X-sender: '.$eol;
> $headers .=3D 'X-receiver: '.$eol;
>
> $headers .=3D 'Message-ID: '.$eol;
> $headers .=3D 'Date: '.$time.$eol;
>
> // Additional headers
> $headers .=3D 'X-Priority: 1'.$eol;
> $headers .=3D 'X-MSMail-Priority: High'.$eol;
> $headers .=3D 'X-MimeOLE: Generated By Design Drumm - MultiPart/Alt
> E-Mail'.$eol;
>
> $headers .=3D 'MIME-Version: 1.0' . $eol;
> $headers .=3D 'Content-type: multipart/alternative';
> $headers .=3D 'boundary=3D"'.$boundary.'"' . $eol.$eol;
>
> // Make sure there are no bare linefeeds in the headers
> //$headers =3D preg_replace('#(?
> Hi List,
> Good morning. Hope all are well on this Saturday.
> I am in =C2=A0need of a little assistance. I am creating an HTML email.
> I have created it successfully already, so I know the code works for the
> HTML part.
> My question is about the headers of the message.
>
> Here is my code at the end before the message is sent off.
>
> //other code =C2=A0that sets up $html and $text
>
> if (strtoupper(substr(PHP_OS, 0, 3) =3D=3D 'WIN')) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$eol=3D"\r\n";
> =C2=A0 =C2=A0 =C2=A0 =C2=A0} else if (strtoupper(substr(PHP_OS, 0, 3) =3D=
=3D 'MAC')) {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 $eol=3D"\r";
> =C2=A0 =C2=A0 =C2=A0 =C2=A0} else {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$eol=3D"\n";
> }
>
> // To send HTML mail, the Content-type header must be set
> $headers =3D 'From: '.$from.$eol;
> $headers .=3D 'To: "'. $username .'" '.$eol;
>
> //$headers .=3D 'Cc: ' . $from;
> //$headers .=3D 'BCc: ' . $from;
> $headers .=3D 'Reply-To: ' . $from .$eol;
>
> $headers .=3D 'X-Mailer: PHP/' . phpversion().$eol;
> $headers .=3D 'X-sender: '.$eol;
> $headers .=3D 'X-receiver: '.$eol;
>
> $headers .=3D 'Message-ID: '.$eol;
> $headers .=3D 'Date: '.$time.$eol;
>
> // Additional headers
> $headers .=3D 'X-Priority: 1'.$eol;
> $headers .=3D 'X-MSMail-Priority: High'.$eol;
> $headers .=3D 'X-MimeOLE: Generated By Design Drumm - MultiPart/Alt
> E-Mail'.$eol;
>
> $headers .=3D 'MIME-Version: 1.0' . $eol;
> $headers .=3D 'Content-type: multipart/alternative';
> $headers .=3D 'boundary=3D"'.$boundary.'"' . $eol.$eol;
>
> // Make sure there are no bare linefeeds in the headers
> //$headers =3D preg_replace('#(?
Thanks Richard for your response,
Since the code is a little long, I didn't want to post too much, so
I just put the last part with the headers I was using.
also, since the mailer worked previously,
I was thinking it was just the new header info I was plugging in
so to do the whole checking if a user can receive HTML emails or text.
Any thoughts on what order I should be putting the headers I have?
TIA,
Karl
On Jan 30, 2010, at 7:13 AM, Richard Quadling wrote:
> On 30 January 2010 13:04, Karl DeSaulniers
> wrote:
>> Hi List,
>> Good morning. Hope all are well on this Saturday.
>> I am in need of a little assistance. I am creating an HTML email.
>> I have created it successfully already, so I know the code works
>> for the
>> HTML part.
>> My question is about the headers of the message.
>>
>> Here is my code at the end before the message is sent off.
>>
>> //other code that sets up $html and $text
>>
>> if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
>> $eol="\r\n";
>> } else if (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) {
>> $eol="\r";
>> } else {
>> $eol="\n";
>> }
>>
>> // To send HTML mail, the Content-type header must be set
>> $headers = 'From: '.$from.$eol;
>> $headers .= 'To: "'. $username .'" '.$eol;
>>
>> //$headers .= 'Cc: ' . $from;
>> //$headers .= 'BCc: ' . $from;
>> $headers .= 'Reply-To: ' . $from .$eol;
>>
>> $headers .= 'X-Mailer: PHP/' . phpversion().$eol;
>> $headers .= 'X-sender: '.$eol;
>> $headers .= 'X-receiver: '.$eol;
>>
>> $headers .= 'Message-ID: '.$eol;
>> $headers .= 'Date: '.$time.$eol;
>>
>> // Additional headers
>> $headers .= 'X-Priority: 1'.$eol;
>> $headers .= 'X-MSMail-Priority: High'.$eol;
>> $headers .= 'X-MimeOLE: Generated By Design Drumm - MultiPart/Alt
>> E-Mail'.$eol;
>>
>> $headers .= 'MIME-Version: 1.0' . $eol;
>> $headers .= 'Content-type: multipart/alternative';
>> $headers .= 'boundary="'.$boundary.'"' . $eol.$eol;
>>
>> // Make sure there are no bare linefeeds in the headers
>> //$headers = preg_replace('#(? at http://phpmailer.worxware.com/
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : http://zend.com/zce.php?
> c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Karl DeSaulniers
Design Drumm
http://designdrumm.com
Since the code is a little long, I didn't want to post too much, so
I just put the last part with the headers I was using.
also, since the mailer worked previously,
I was thinking it was just the new header info I was plugging in
so to do the whole checking if a user can receive HTML emails or text.
Any thoughts on what order I should be putting the headers I have?
TIA,
Karl
On Jan 30, 2010, at 7:13 AM, Richard Quadling wrote:
> On 30 January 2010 13:04, Karl DeSaulniers
> wrote:
>> Hi List,
>> Good morning. Hope all are well on this Saturday.
>> I am in need of a little assistance. I am creating an HTML email.
>> I have created it successfully already, so I know the code works
>> for the
>> HTML part.
>> My question is about the headers of the message.
>>
>> Here is my code at the end before the message is sent off.
>>
>> //other code that sets up $html and $text
>>
>> if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
>> $eol="\r\n";
>> } else if (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) {
>> $eol="\r";
>> } else {
>> $eol="\n";
>> }
>>
>> // To send HTML mail, the Content-type header must be set
>> $headers = 'From: '.$from.$eol;
>> $headers .= 'To: "'. $username .'" '.$eol;
>>
>> //$headers .= 'Cc: ' . $from;
>> //$headers .= 'BCc: ' . $from;
>> $headers .= 'Reply-To: ' . $from .$eol;
>>
>> $headers .= 'X-Mailer: PHP/' . phpversion().$eol;
>> $headers .= 'X-sender: '.$eol;
>> $headers .= 'X-receiver: '.$eol;
>>
>> $headers .= 'Message-ID: '.$eol;
>> $headers .= 'Date: '.$time.$eol;
>>
>> // Additional headers
>> $headers .= 'X-Priority: 1'.$eol;
>> $headers .= 'X-MSMail-Priority: High'.$eol;
>> $headers .= 'X-MimeOLE: Generated By Design Drumm - MultiPart/Alt
>> E-Mail'.$eol;
>>
>> $headers .= 'MIME-Version: 1.0' . $eol;
>> $headers .= 'Content-type: multipart/alternative';
>> $headers .= 'boundary="'.$boundary.'"' . $eol.$eol;
>>
>> // Make sure there are no bare linefeeds in the headers
>> //$headers = preg_replace('#(? at http://phpmailer.worxware.com/
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : http://zend.com/zce.php?
> c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Karl DeSaulniers
Design Drumm
http://designdrumm.com
On 30 January 2010 13:23, Karl DeSaulniers wrote:
> Thanks Richard for your response,
> Since the code is a little long, I didn't want to post too much, so
> I just put the last part with the headers I was using.
> also, since the mailer worked previously,
> I was thinking it was just the new header info I was plugging in
> so to do the whole checking if a user can receive HTML emails or text.
>
> Any thoughts on what order I should be putting the headers I have?
> TIA,
>
> Karl
>
>
> On Jan 30, 2010, at 7:13 AM, Richard Quadling wrote:
>
>> On 30 January 2010 13:04, Karl DeSaulniers wrote:
>>>
>>> Hi List,
>>> Good morning. Hope all are well on this Saturday.
>>> I am in =C2=A0need of a little assistance. I am creating an HTML email.
>>> I have created it successfully already, so I know the code works for th=
e
>>> HTML part.
>>> My question is about the headers of the message.
>>>
>>> Here is my code at the end before the message is sent off.
>>>
>>> //other code =C2=A0that sets up $html and $text
>>>
>>> if (strtoupper(substr(PHP_OS, 0, 3) =3D=3D 'WIN')) {
>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 $eol=3D"\r\n";
>>> =C2=A0 =C2=A0 =C2=A0 } else if (strtoupper(substr(PHP_OS, 0, 3) =3D=3D =
'MAC')) {
>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0$eol=3D"\r";
>>> =C2=A0 =C2=A0 =C2=A0 } else {
>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 $eol=3D"\n";
>>> }
>>>
>>> // To send HTML mail, the Content-type header must be set
>>> $headers =3D 'From: '.$from.$eol;
>>> $headers .=3D 'To: "'. $username .'" '.$eol;
>>>
>>> //$headers .=3D 'Cc: ' . $from;
>>> //$headers .=3D 'BCc: ' . $from;
>>> $headers .=3D 'Reply-To: ' . $from .$eol;
>>>
>>> $headers .=3D 'X-Mailer: PHP/' . phpversion().$eol;
>>> $headers .=3D 'X-sender: '.$eol;
>>> $headers .=3D 'X-receiver: '.$eol;
>>>
>>> $headers .=3D 'Message-ID: '.$eol;
>>> $headers .=3D 'Date: '.$time.$eol;
>>>
>>> // Additional headers
>>> $headers .=3D 'X-Priority: 1'.$eol;
>>> $headers .=3D 'X-MSMail-Priority: High'.$eol;
>>> $headers .=3D 'X-MimeOLE: Generated By Design Drumm - MultiPart/Alt
>>> E-Mail'.$eol;
>>>
>>> $headers .=3D 'MIME-Version: 1.0' . $eol;
>>> $headers .=3D 'Content-type: multipart/alternative';
>>> $headers .=3D 'boundary=3D"'.$boundary.'"' . $eol.$eol;
>>>
>>> // Make sure there are no bare linefeeds in the headers
>>> //$headers =3D preg_replace('#(?> at http://phpmailer.worxware.com/
>>
>> --
>> -----
>> Richard Quadling
>> "Standing on the shoulders of some very clever giants!"
>> EE : http://www.experts-exchange.com/M_248814.html
>> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
>> Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213=
474731
>> ZOPA : http://uk.zopa.com/member/RQuadling
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
I use RMail. With that ...
$RMail->addText($TextMessage);
$RMail->addHTML($HTMLMessage, $DirForImages);
That's it.
If the client can only read text, it will show the text. Otherwise it
will show the HTML.
The alternative headers are all taken care of by the class.
--=20
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474=
731
ZOPA : http://uk.zopa.com/member/RQuadling
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> Thanks Richard for your response,
> Since the code is a little long, I didn't want to post too much, so
> I just put the last part with the headers I was using.
> also, since the mailer worked previously,
> I was thinking it was just the new header info I was plugging in
> so to do the whole checking if a user can receive HTML emails or text.
>
> Any thoughts on what order I should be putting the headers I have?
> TIA,
>
> Karl
>
>
> On Jan 30, 2010, at 7:13 AM, Richard Quadling wrote:
>
>> On 30 January 2010 13:04, Karl DeSaulniers wrote:
>>>
>>> Hi List,
>>> Good morning. Hope all are well on this Saturday.
>>> I am in =C2=A0need of a little assistance. I am creating an HTML email.
>>> I have created it successfully already, so I know the code works for th=
e
>>> HTML part.
>>> My question is about the headers of the message.
>>>
>>> Here is my code at the end before the message is sent off.
>>>
>>> //other code =C2=A0that sets up $html and $text
>>>
>>> if (strtoupper(substr(PHP_OS, 0, 3) =3D=3D 'WIN')) {
>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 $eol=3D"\r\n";
>>> =C2=A0 =C2=A0 =C2=A0 } else if (strtoupper(substr(PHP_OS, 0, 3) =3D=3D =
'MAC')) {
>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0$eol=3D"\r";
>>> =C2=A0 =C2=A0 =C2=A0 } else {
>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 $eol=3D"\n";
>>> }
>>>
>>> // To send HTML mail, the Content-type header must be set
>>> $headers =3D 'From: '.$from.$eol;
>>> $headers .=3D 'To: "'. $username .'" '.$eol;
>>>
>>> //$headers .=3D 'Cc: ' . $from;
>>> //$headers .=3D 'BCc: ' . $from;
>>> $headers .=3D 'Reply-To: ' . $from .$eol;
>>>
>>> $headers .=3D 'X-Mailer: PHP/' . phpversion().$eol;
>>> $headers .=3D 'X-sender: '.$eol;
>>> $headers .=3D 'X-receiver: '.$eol;
>>>
>>> $headers .=3D 'Message-ID: '.$eol;
>>> $headers .=3D 'Date: '.$time.$eol;
>>>
>>> // Additional headers
>>> $headers .=3D 'X-Priority: 1'.$eol;
>>> $headers .=3D 'X-MSMail-Priority: High'.$eol;
>>> $headers .=3D 'X-MimeOLE: Generated By Design Drumm - MultiPart/Alt
>>> E-Mail'.$eol;
>>>
>>> $headers .=3D 'MIME-Version: 1.0' . $eol;
>>> $headers .=3D 'Content-type: multipart/alternative';
>>> $headers .=3D 'boundary=3D"'.$boundary.'"' . $eol.$eol;
>>>
>>> // Make sure there are no bare linefeeds in the headers
>>> //$headers =3D preg_replace('#(?> at http://phpmailer.worxware.com/
>>
>> --
>> -----
>> Richard Quadling
>> "Standing on the shoulders of some very clever giants!"
>> EE : http://www.experts-exchange.com/M_248814.html
>> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
>> Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213=
474731
>> ZOPA : http://uk.zopa.com/member/RQuadling
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
I use RMail. With that ...
$RMail->addText($TextMessage);
$RMail->addHTML($HTMLMessage, $DirForImages);
That's it.
If the client can only read text, it will show the text. Otherwise it
will show the HTML.
The alternative headers are all taken care of by the class.
--=20
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474=
731
ZOPA : http://uk.zopa.com/member/RQuadling
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Related Threads
- unicode encoding problem - django
- [Bug 21257] New: EVE online dominion crash - wine
- [crx] Install button in the Gallery entry has no effect - chromium
- [Hendrix] slow - firefox
- Re: [Cooker] Project DependenciasDRAKE: code is available - mandriva
- [PATCH] xkb: convert XkbUseCorePtr and XkbUseCoreKbd into PickPointer/Keyboard. - xorg
- [Hendrix] Disadvantage I experienced with Firefox 3.6rc1 - firefox
- [opensuse] Installing NFS -- revisited - opensuse
- [PHP-DEV] Can we call Apache 2 API function from a PHP 5 extension module? - php
- [Hendrix] my preferences - firefox
- Green Screen with HDMI on RV730 - xorg
- AutoDeb (was Mozilla apps?) - ubuntu