Jump to content

PHP HTML EMAIL


Recommended Posts

Hi! All

I'm Krishnam and I'm trying hard to send FORM details from an HTML FORM to an Email in the form of an HTML mail.

Please find the screen shot of my FORM at http://www.krishnamraju.com/devnar/html/school_application.html

 

And the mail that will be sent to the mentioned email id should look like http://www.krishnamraju.com/devnar/html/mail_format.html displaying the data from the FORM in the corresponding right cells.

 

Please help me.

 

Thanks a lot in advance.

Krishnam

Link to comment
https://forums.phpfreaks.com/topic/113413-php-html-email/
Share on other sites

Hi!

Thanks a lot for the reply.

But I'm very new to PHP. Can you please provide me with an example? So that i could work on it and implement it to the whole form.

 

Please help.

 

Thank you

Krishnam

 

Is in the PEAR manual :)

 

http://pear.php.net/manual/en/package.mail.mail-mime.example.php

Link to comment
https://forums.phpfreaks.com/topic/113413-php-html-email/#findComment-582783
Share on other sites

I posted this for another question but you may find it useful as well.

 

I am going to have to suggest a PHP Mailer class that I have been using for some time now. It's VERY fast and has yet to let me down.

 

http://phpmailer.codeworxtech.com/

 

This is a VERY extensive class and has lost of room to add if you are in to that but the basic idea will get you started and emailing in PHP fast and easy.

 

Here is a basic example of how to send an HTML email.

 

<?php

require("class.phpmailer.php");

$mail = new PHPMailer();

$mail->ClearAddresses();
$mail->AddAddress($_POST['email']);
$mail->FromName = "My Name";
$mail->FromAddress = "[email protected]";

$mail->IsHTML(true);
$mail->WordWarp

$mail->Subject = "Thank you!";

$body  = "<div><h4>My Title!</h4></div>";
$body .= "Thank you Info what not here blah blah<br><br>";
$body .= "<p>Your Var = ".$myVar."</p>";

$this->Body = $body;

if($mail->Send() !== false)
{
     echo "YAY WE DID IT!";
}
else
{
    echo "Jump!";
}

?>

 

I hope this helps you!

Link to comment
https://forums.phpfreaks.com/topic/113413-php-html-email/#findComment-582846
Share on other sites

you need to make sure that the language dir is there as well, and if you can post your error message that you are getting that would help tons.... if you are not getting one then at the very top of the script insert the code below.

 

<?php

error_reporting(E_ALL);

?>

Link to comment
https://forums.phpfreaks.com/topic/113413-php-html-email/#findComment-582879
Share on other sites

hi!

i did it but nothing happened. no error message. it says http 500.

 

Here is the code

 

<?php
error_reporting(E_ALL);
require("class.phpmailer.php");

$mail = new PHPMailer();

$mail->ClearAddresses();
$mail->AddAddress($_POST['email']);
$mail->FromName = "My Name";
$mail->FromAddress = "[email protected]";

$mail->IsHTML(true);
$mail->WordWarp

$mail->Subject = "Thank you!";

$body  = "<div><h4>My Title!</h4></div>";
$body .= "Thank you Info what not here blah blah<br><br>";
$body .= "<p>Your Var = ".$myVar."</p>";

$this->Body = $body;

if($mail->Send() !== false)
{
     echo "YAY WE DID IT!";
}
else
{
    echo "Jump!";
}

?>

Link to comment
https://forums.phpfreaks.com/topic/113413-php-html-email/#findComment-582889
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.