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
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 = "me@mail.com";

$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
Share on other sites

Yes, when you download the phpMailer and extract it if you put the script i posted into that same dir it should work. You may need to change some things as far as vars go but that's it. Let me know if you need more then that. :D

Link to comment
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
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 = "krishnam.vizag@gmail.com";

$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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.