Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

Working Mail script, but need redirect function

the mail() function

Moderators: macek, egami, gesf

Working Mail script, but need redirect function

Postby Pixelpusher28 » Thu Nov 08, 2012 10:56 pm

Hi,
I'm a designer and usually only need a simple PHP mail script that sends text mails and redirects to a "thank you"- page. But now a client wants HTML mails because of the better readability (mails with lots of technical specifications). I found a nice, simple script that sends HTML mails and is even simpler than my old script, but sadly it doesn't have a redirect function. I would be very thankful if someone could help and just add the little redirect funtion to this script.
PS: the script also has to send German Umlauts and special characters.

Here is the script:

Code: Select all
<?php
$destination = "your@mail.com";

$message = "<html>
<body style=\"font-family:Arial; font-size:10pt;\">
Hello,<br>
You have recieved a submission through the form on your website:<br><br>
";
//Gather posted variables:
foreach($_POST as $keys => $vars){
$message .= "<b>$keys</b>: $vars<br>";
}
$message .= "
</body>
</html>
";

mail($destination,"Form Submission",$message,"From: $email\n".
"Content-Type: text/html; charset=\"iso-8859-1\"\n".
"Content-Transfer-Encoding: quoted-printable".
"Content-Transfer-Encoding: 7bit\n".
"MIME-Version: 1.0\n");
?>


Any help is appreciated. Thanks a lot.
Pixelpusher28
New php-forum User
New php-forum User
 
Posts: 1
Joined: Thu Nov 08, 2012 10:31 pm

Re: Working Mail script, but need redirect function

Postby aravindoptimus » Thu Mar 07, 2013 4:26 am

Just use the following idea:

If(mail(Sendmail_function))
{
Header_redirect; (check the Header redirect script)
}
else
{
echo "Sorry we cant send your mail at the moment";
}
8)
User avatar
aravindoptimus
New php-forum User
New php-forum User
 
Posts: 11
Joined: Thu Mar 07, 2013 2:00 am


Return to PHP coding => Mail

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron