FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Suggestions on formatting an outgoing email message
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Suggestions on formatting an outgoing email message [message #181105] Sat, 13 April 2013 20:57 Go to next message
r.mariotti is currently offline  r.mariotti
Messages: 17
Registered: December 2011
Karma: 0
Junior Member
In a very small php program that runs at the end of a daily
production job I generate an informational email message send to the
system administrator. No matter which of the two methods used below
to generate the message the results are received unformatted.

// generate email message method 1

$Mailmsg = "[abc.sh] Daily Results Retrieval Job\n\n";
$Mailmsg .= "One or more error(s) occured during the last\n";
$Mailmsg .= "execution of the above referenced script.\n\n";
$Mailmsg .= "$Errs\n";
$Mailmsg .= "Please review/research file daily.log\n";
$Mailmsg .= "for more details.\n";

// generate email message method 2

$Mailmsg = <<<EOD
[abc.sh] Daily Results Retrieval Job

One or more error(s) occured during the last
execution of the above referenced script.

$Errs
Please review/research file daily.log
for more details.
EOD;


Either one results in the received message being format as:

[abc.sh] Daily Results Retrieval Job One or more error(s) occured
during the last execution of the above referenced script. {content of
the $Errs file} Please review/research file daily.log for more
details.


I'm using PHPMailer to generate/send this message. I do, however, use
both these techniques in other programs with the same function and the
messages are formatted corrected.

Any suggestions/ideas?

Thanks
Re: Suggestions on formatting an outgoing email message [message #181106 is a reply to message #181105] Sat, 13 April 2013 21:17 Go to previous messageGo to next message
Christoph Becker is currently offline  Christoph Becker
Messages: 91
Registered: June 2012
Karma: 0
Member
BobMCT wrote:
> Any suggestions/ideas?

Line breaks in emails have to be "\r\n"; see RFC 5322.

--
Christoph M. Becker
Re: Suggestions on formatting an outgoing email message [message #181107 is a reply to message #181106] Sat, 13 April 2013 23:50 Go to previous messageGo to next message
r.mariotti is currently offline  r.mariotti
Messages: 17
Registered: December 2011
Karma: 0
Junior Member
On Sat, 13 Apr 2013 23:17:30 +0200, Christoph Becker
<cmbecker69(at)gmx(dot)de> wrote:

> Becker

Thanks for the very quick reply. However, tried it and it didn't
make any difference. I will also look into the referenced rfc.
Re: Suggestions on formatting an outgoing email message [message #181108 is a reply to message #181105] Sun, 14 April 2013 00:22 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 4/13/2013 4:57 PM, BobMCT wrote:
> In a very small php program that runs at the end of a daily
> production job I generate an informational email message send to the
> system administrator. No matter which of the two methods used below
> to generate the message the results are received unformatted.
>
> // generate email message method 1
>
> $Mailmsg = "[abc.sh] Daily Results Retrieval Job\n\n";
> $Mailmsg .= "One or more error(s) occured during the last\n";
> $Mailmsg .= "execution of the above referenced script.\n\n";
> $Mailmsg .= "$Errs\n";
> $Mailmsg .= "Please review/research file daily.log\n";
> $Mailmsg .= "for more details.\n";
>
> // generate email message method 2
>
> $Mailmsg = <<<EOD
> [abc.sh] Daily Results Retrieval Job
>
> One or more error(s) occured during the last
> execution of the above referenced script.
>
> $Errs
> Please review/research file daily.log
> for more details.
> EOD;
>
>
> Either one results in the received message being format as:
>
> [abc.sh] Daily Results Retrieval Job One or more error(s) occured
> during the last execution of the above referenced script. {content of
> the $Errs file} Please review/research file daily.log for more
> details.
>
>
> I'm using PHPMailer to generate/send this message. I do, however, use
> both these techniques in other programs with the same function and the
> messages are formatted corrected.
>
> Any suggestions/ideas?
>
> Thanks
>

Are you sending the message as plain text or html? What does the
message source look like?

What's the rest of your code look like? Break it down to the minimum
necessary for us to recreate your problem.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: Suggestions on formatting an outgoing email message [message #181111 is a reply to message #181106] Sun, 14 April 2013 10:13 Go to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Christoph Becker wrote:

> BobMCT wrote:
>> Any suggestions/ideas?
>
> Line breaks in emails have to be "\r\n"; see RFC 5322.

The OP uses PHPMailer which should take care of that.


PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7(at)news(dot)demon(dot)co(dot)uk> (2004)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: eine PHP mit video faehigkeit
Next Topic: framwork
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 09:56:20 GMT 2024

Total time taken to generate the page: 0.03338 seconds