Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Unknown Sender gmail

Asked Modified Viewed 1,319 times
S
shekhark69
S
  • Newbie, joined since
  • Contributed 1 post on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
asked
Newbie

I created a form with a processing PHP file. Everything works fine. I receive the mail but it's from "Unknow sender" in Gmail. Why please ?

<?php session_start();
if($_POST['Submit'])
{
if($_SESSION['security_code'] == $_POST['security_code'])
{
extract($_POST);

ini_set("extension=php_openssl.dll",true);
ini_set("extension=php_smtp.dll",true);

include_once("phpmailer/class.phpmailer.php");

function calltoMailer($from,$to,$cc,$subject,$message)
{
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->FromName = $_POST['email'];           
$mailer->From = $from;
$mailer->AddAddress($to);
$mailer->AddAddress($cc);
$mailer->Subject = $subject;
$mailer->ContentType="text/html";
$mailer->Body = $message;//'body
try
{
if($mailer->Send())
{
$msgsend =1;
}
else
{
$msgsend =0;
}
}
catch(Excpetion $e)
{
print($mailer->ErrorInfo);
}
return $msgsend;
}   

$to=$_POST['ToEMail'];
$cc=$_POST['CcEMail'];
$subject=$_POST['subject'].$_POST['ResEnq'];

$message="<table width='800' cellspacing='1' cellpadding='8' border='1' align='center' style='color:#5f5f5f;font-family:Arial, Helvetica, sans-serif;font-size:12px;'><tr style='background-color:#72abe4;'><td colspan='2' align='center' style='color:#ffffff'>Enquiry From Hotel Kailas.</td></tr>";
//$message="";

if($_POST['ResEnq'] != '')
$message .= "<tr><td>Type : </td><td>".$_POST['ResEnq']."</td></tr>";

if($_POST['name'] != '')
$message .= "<tr><td>Name : </td><td>".$_POST['name']."</td></tr>";

if($_POST['address'] != '')
$message .= "<tr><td>Address : </td><td>".$_POST['address']."</td></tr>";

if($_POST['phone'] != '')
$message .= "<tr><td>Phone : </td><td>".$_POST['phone']."</td></tr>";

if($_POST['fax'] != '')
$message .= "<tr><td>Fax : </td><td>".$_POST['fax']."</td></tr>";

if($_POST['email'] != '')
$message .= "<tr><td>Email ID : </td><td>".$_POST['email']."</td></tr>";

if($field == 'email'){ $from = $_POST[$field_id]; }

if($_POST['txtFromDate'] != '')
$message .= "<tr><td>Date of Arrival : </td><td>".$_POST['txtFromDate']."</td></tr>";

if($_POST['txtToDate'] != '')
$message .= "<tr><td>Date of Departure : </td><td>".$_POST['txtToDate']."</td></tr>";

if($_POST['No_Of_Persons'] != '')
$message .= "<tr><td>Number of Persons : </td><td>".$_POST['No_Of_Persons']."</td></tr>";

if($_POST['child_yrs'] != '')
$message .= "<tr><td>Children below 10 yrs : </td><td>".$_POST['child_yrs']."</td></tr>";

if($_POST['Type_Of_Cottage'] != '')
$message .= "<tr><td>Type of Cottages/Rooms (Cost in INR / Rs. Per Day) : </td><td>".$_POST['Type_Of_Cottage']."</td></tr>";

if($_POST['No_Of_Cottage'] != '')
$message .= "<tr><td>Number of Cottages Required : </td><td>".$_POST['No_Of_Cottage']."</td></tr>";
$client_ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
$json2 = file_get_contents("http://www.geoplugin.net/php.gp?ip=".$client_ip."");
$data = unserialize($json2);
if($client_ip != '')
$message .= "<tr><td>Client Details : </td><td>".$client_ip." , ".$data['geoplugin_city']. " , " .$data['geoplugin_region']." , ".$data['geoplugin_countryName'];
$message .="</td></tr></table>";
$errorMessage=calltoMailer($txtEmail,$to,$cc,$subject,$message);
$errorMessage = "Your message has been sent to the Webmaster. We will get back to you soon.";
require($_POST['redirect']);
}
else
{
extract($_POST);
$errorMessage = "Security code does not match.";
unset($_SESSION['security_code']);
require($_POST['redirectIssue']);   
}
}
?>
Edited by N/A on 10-05-2016 09:39,
0 replies

1 post

F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

use print_r($_POST); and see what variable is not passed, read correctly.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 1 post
  • Votes 0 votes
  • Topic users 2 members

2 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
S
S
  • Newbie, joined since
  • Contributed 1 post on the community forums.
  • Started 1 thread in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet