Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Embedding html in $message

Engaged ,
Apr 02, 2008 Apr 02, 2008
I may be going about this the wrong way but I am trying to automate a report to be sent to a mail recipient.

I have created a php page report and then added the attached code to create an e-mail to a specific individual.

As you will see, the $message variable only carries simple text as it is part of a php script (which does not like embedded <script>)

Does anyone know how to go about putting in a dynamic table for example?

Any help would be much appreciated.

Thanks
TOPICS
Server side applications
396
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Apr 03, 2008 Apr 03, 2008
Thanks Ken

I had already done most of what this tutorial says (which is excellent!) and I found that the problem was my " opener for the variable content.

As " was used within the variable, it was ending the variable content at that point.

What I had to do was use an alternative ' and split off any php code by using ' . '
Translate
LEGEND ,
Apr 02, 2008 Apr 02, 2008
Talks about HTML email in this tutorial:

http://www.sitepoint.com/article/advanced-email-php

--
Ken Ford
Adobe Community Expert - Dreamweaver
Fordwebs, LLC
http://www.fordwebs.com


"RichardODreamweaver" <webforumsuser@macromedia.com> wrote in message
news:fsvsp8$opv$1@forums.macromedia.com...
>I may be going about this the wrong way but I am trying to automate a
>report to
> be sent to a mail recipient.
>
> I have created a php page report and then added the attached code to
> create an
> e-mail to a specific individual.
>
> As you will see, the $message variable only carries simple text as it is
> part
> of a php script (which does not like embedded <script>)
>
> Does anyone know how to go about putting in a dynamic table for example?
>
> Any help would be much appreciated.
>
> Thanks
>
> <?php if ($totalRows_outstandingquotes > 0) { // Process if recordset not
> empty ?>
> <?php
> $contactemail = "someone@somewhere.com";
>
> $headers = 'MIME-Version: 1.0' . "\n";
> $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
> $headers .= "Content-Transfer-Encoding: 7bit\n";
> $headers .= 'From: Me (' .stripslashes($_POST['email']). ')' . "\n";
> $headers .= 'Reply-To: '.stripslashes($_POST['email']). "\n";
> $headers .= 'Return-Path:'.$contactemail . "\n";
> $headers .= 'X-Sender: '.$contactemail. "\n";
> $headers .= 'X-Mailers: PHP /'.phpversion() . "\n";
>
> $subject = "CRM Automated Report: New Opportunities Pending Approval";
>
> $message = "
> <p>There is at least one opportunity, with a quantity less than 4,
> pending
> approval.<p>
> <p>to view and approve them, you will need to login to the CRM
> Database<p>
> ";
>
>
> ini_set(sendmail_from,$contactemail);
>
> if (@mail('Me
> <'.$contactemail.'>',stripslashes($subject),stripslashes($message),stripslashes(
> $headers)))
> {
> echo ('<h1>Sent</h1><p>This automated report has been successfully
> sent.</p>');
> }
> else
> {
> echo ('<h1>Sorry!</h1><p>Your message has failed to send. Please try
> again
> later.</p>');
> }
>
>
> ini_restore( sendmail_from );
>
> ?>
> <?php } ?>
>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 03, 2008 Apr 03, 2008
LATEST
Thanks Ken

I had already done most of what this tutorial says (which is excellent!) and I found that the problem was my " opener for the variable content.

As " was used within the variable, it was ending the variable content at that point.

What I had to do was use an alternative ' and split off any php code by using ' . '
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines