Forums
This topic is locked
E-Mail Scripts
Posted 10 Nov 2006 09:42:51
1
has voted
10 Nov 2006 09:42:51 andre montaut posted:
Hi,I have been looking for some PHP scripts for e-mail forms but the ones I found were not useful. At the moment I am using a Flash e-mail form and the info is submitted to a cgi script which is then sent to me. This way I can make a seperate frame in flash so that once the form is submitted I can direct them to another page but I was wanting to do that with PHP.
Any help would be appreciated. Thanks.
<b>P.S. - Centre Holidays has all your travel needs </b>
<img src="http://i51.photobucket.com/albums/f392/snackman_84/jetaboutprofile.gif" border=0>
Edited by - snackman on 10 Nov 2006 09:46:44
Replies
Replied 20 Nov 2006 18:28:38
20 Nov 2006 18:28:38 Roddy Dairion replied:
<pre id=code><font face=courier size=2 id=code> $to = "
"
$subject = "Your subject";
$message=$_POST['messagefield'];
$from="FROM:".$_POST['usersemailaddress'];
$headers = "MIME-Version: 1.0\r\n".
"Content-type: text/plain; charset=iso-8859-1\r\n".
"From: $from \r\n".
"To: $to \r\n".
"Date: ".date("r"."\r\n".
"Subject: ".$subject."\r\n";
mail($to, $subject, $message, $from, $headers);
</font id=code></pre id=code>
$subject = "Your subject";
$message=$_POST['messagefield'];
$from="FROM:".$_POST['usersemailaddress'];
$headers = "MIME-Version: 1.0\r\n".
"Content-type: text/plain; charset=iso-8859-1\r\n".
"From: $from \r\n".
"To: $to \r\n".
"Date: ".date("r"."\r\n".
"Subject: ".$subject."\r\n";
mail($to, $subject, $message, $from, $headers);
</font id=code></pre id=code>
Replied 21 Nov 2006 08:26:04
21 Nov 2006 08:26:04 andre montaut replied:
Kool. Is there anyway I can make it point to another page once they hit submit.
<img src="http://i51.photobucket.com/albums/f392/snackman_84/jetaboutprofile-1.gif" border=0>
<b>P.S. - Vote For JETABOUT.CA</b>
<img src="http://i51.photobucket.com/albums/f392/snackman_84/jetaboutprofile-1.gif" border=0>
<b>P.S. - Vote For JETABOUT.CA</b>
Replied 21 Nov 2006 10:42:32
21 Nov 2006 10:42:32 Roddy Dairion replied:
at the end of the script just add
<pre id=code><font face=courier size=2 id=code>header("Location:yourpage.html"</font id=code></pre id=code>
Edited by - roders22 on 21 Nov 2006 10:43:51
<pre id=code><font face=courier size=2 id=code>header("Location:yourpage.html"</font id=code></pre id=code>
Edited by - roders22 on 21 Nov 2006 10:43:51
Replied 30 Nov 2006 14:18:07
30 Nov 2006 14:18:07 Oriyomi Shokunbi replied:
Hi,
I will like to know i this scripts can be used to send muti-emails.
Sending multi emails using commas, can you do it in the bcc format
Urmy
I will like to know i this scripts can be used to send muti-emails.
Sending multi emails using commas, can you do it in the bcc format
Urmy
Replied 30 Nov 2006 16:23:28
30 Nov 2006 16:23:28 Roddy Dairion replied:
you can't do bcc but you can cheat. Suppose you have 3 email address to send it to and you dn't want any of those to know who you've send it to.
Then use a for loop and cheat.
e.g.
<pre id=code><font face=courier size=2 id=code>
$to = " , , ";
</font id=code></pre id=code>
all you need to do is break down the $to by doing this
<pre id=code><font face=courier size=2 id=code>
$eachto = explode("," $to);
</font id=code></pre id=code>
So after each comma you'll get a new email address now just use a for loop
<pre id=code><font face=courier size=2 id=code>
for ($i = 0; $i < count($eachto); $i++){
mail($eachto[$i], $subject, $message, $from, $headers);
}
</font id=code></pre id=code>
Simple isn't it?
Then use a for loop and cheat.
e.g.
<pre id=code><font face=courier size=2 id=code>
$to = " , , ";
</font id=code></pre id=code>
all you need to do is break down the $to by doing this
<pre id=code><font face=courier size=2 id=code>
$eachto = explode("," $to);
</font id=code></pre id=code>
So after each comma you'll get a new email address now just use a for loop
<pre id=code><font face=courier size=2 id=code>
for ($i = 0; $i < count($eachto); $i++){
mail($eachto[$i], $subject, $message, $from, $headers);
}
</font id=code></pre id=code>
Simple isn't it?