Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,494 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,705 people online right now. Registration is fast and FREE... Join Now!




Email Connection in PHP

 
Reply to this topicStart new topic

Email Connection in PHP

syed_danish
3 Feb, 2008 - 09:02 PM
Post #1

New D.I.C Head
*

Joined: 3 Feb, 2008
Posts: 1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>EMAIL</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
ob_start();
/*
$to ="info@travelfaa.com";
$subject ="Mail From TravelFaa website";
$body ="Product Interested = " . $_POST["product"] . "\nName = " . $_POST["name"] . "\nPhone Number = " . $_POST["phonenumber"]. "\nEmail = " . $_POST["email"]. "\nServices = " . $_POST["services"]. "\nComment = " . $_POST["comment"];
$headers = "From: " . $_POST["email"] . "\r\n";
$headers .= 'Bcc: aamir.virani@evision.com.pk' . "\r\n";


if (mail ($to,$subject,$body,$headers))
{
//
header("Location: http://www.travelfaa.com/thanks.html");
echo "Mail Send";
}
else
{
echo "Mail Not Send";
}

*/

?>


<?php
ob_start();
//Email from PHPMailer
require("class.phpmailer.php");
$mail = new PHPMailer();
//$txt_email = "mudassar_iqbal_9@hotmail.com";
//$txt_email = "umair.jaffar97@gmail.com";
$txt_email = "syed_danish2@hotmail.com";

$email = $txt_email;
$from = "syed_danish2@hotmail.com";
$mail->IsSMTP();
// send via SMTP
//$mail->Host = "www.travelfaa.com"; // SMTP servers www.evision.com.pk
$mail->Host = "www.evision.com.pk";
// SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = ""; // SMTP username
$mail->Password = ""; // SMTP password

$mail->From = $from;
$mail->FromName = "Travelfaa";
$mail->AddAddress($email,"");
//$mail->AddAddress("ellen@site.com");
// optional name
$mail->AddReplyTo("syed_danish2@hotmail.com","Travelfaa - Info");

$mail->WordWrap = 50; // set word wrap
//$mail->AddAttachment("/var/tmp/file.tar.gz");
// attachment
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
$mail->IsHTML(true);
// send as HTML

$mail->Subject = "Mail From TravelFaa Website";
$mail->Body = "This is testing email to Mudassar From Umair";
//"Product Interested = " . $_POST["product"] . "\nName = " . $_POST["name"] . "\nPhone Number = " . $_POST["phonenumber"]. "\nEmail = " . $_POST["email"]. "\nServices = " . $_POST["services"]. "\nComment = " . $_POST["comment"];

//$mail->AltBody = "This is the text-only body";


if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}

header("location: http://www.travelfaa.com/thanks.html");
echo "Mail Send";
/* $to = "syed_danish2@hotmail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "syed_danish2@hotmail.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent."; */?>

</body>
</html>

User is offlineProfile CardPM
+Quote Post

skyhawk133
RE: Email Connection In PHP
3 Feb, 2008 - 09:03 PM
Post #2

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 14,947



Thanked: 47 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
Nice code... what do you want us to do with it?
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 07:58PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month