Bluehost.com Web Hosting $6.95

PHP email message composing

This is a discussion on PHP email message composing within the PHP General forums, part of the PHP Programming Forums category; Hi all, I am trying to create an automatic email composing script, but I have one big problem here. The ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-24-2003
Cesar Aracena
 
Posts: n/a
Default PHP email message composing

Hi all,

I am trying to create an automatic email composing script, but I have
one big problem here. The message composing method I'm using is the
following:

/* message */
$message = '
<html>
<head>
<title>Solicitud de Presupuesto</title>
</head>
<body>
<SPAN style="FONT-FAMILY: arial; FONT-SIZE: 14px">
El siguiente mensaje ha sido enviado desde la página de
presupuesto de icaam.com.ar:
</SPAN>
<br><br>
<table cellspacing="0" cellpadding="5" border="0">
<tr>
<td align="right">
[SNIP]

And after a while, I have to know which are the options the visitor has
selected. The options might vary depending on two different selections,
which are "guided" using arrays. What I've done so far, and doesn't work
is:

'.if (isset($checkbox[0]))
{.'
<tr>
<td align="right" valign="top">
<SPAN style="FONT-FAMILY: arial; FONT-SIZE: 12px">Tipo de Sitio
Web</SPAN>
</td>
<td valign="middle">
'.foreach ($tipo as $key => $value)
{
echo $value."<BR>";
}.'
</td>
</tr>
}.'

[SNIP]

Any ideas on why this isn't working? In another rows, I say for example
"Name is '.$first_name.'" (without wuotes) and it works just fine but
for the "IF" lines it throws me a parse error... How can I solve this?
I've even tried with double quote with the same results.

Thanks in advanced,
Cesar Aracena
<http://www.icaam.com.ar> www.icaam.com.ar


Reply With Quote
  #2 (permalink)  
Old 09-24-2003
Dan Anderson
 
Posts: n/a
Default Re: [PHP] PHP email message composing

Instead of putting your message in your code like that, why not just put
it in a seperate text file and do: $message = implode(" ",
file("./message")); ? This will make your code look cleaner. So you
could create something like:

$message = implode(" ", file("./message1"));
if (isset($checkbox[0]))
{ $message .= implode(" ", file("./checkbox1")); }
$message .= implode(" ", file("./message2"));
foreach ($tipo as $key => $value)
{ echo $value . '<br>'; }
etc.

I noticed a lot of .s in your code. I know ;s end statements, but I
didn't know dots (concatenation operator) worked to do that as well.
Have you tried using semicolons?

-Dan
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 03:16 AM.


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