Whats wrong with this php script?
-
<?php if(!isset($_GET[fake]) ||($_GET[fake])) { $from=$_GET[fake]; } if(!isset($_GET[header]) ||($_GET[header])) { $subject=$_GET[header]; } if(!isset($_GET[email]) ||($_GET[email])) { $to=$_GET[email]; } if(!isset($_GET[message]) ||($_GET[message])) { $message=$_GET[message]; } $headers="MIME-Version:1.0"."\r\n";$he… $headers.="From:".$from."<".$from.">".… if(mail($to,$subject,$message,$headers… { echo"<body bgcolor='CDAF95'><title>Email Sent</title><font color='blue'><b><h1><div style='background-color:6666FF' align='center'><font color='white'>Success</font><div></h1>\n… align='center'><font color='red'>The e-mail was successfully sent! </div></font><p></font><font color='red'>To:</font><font color='white'><i>".$to."</i></p>\n";echo… color='red'>From:</font><font color='white'><i>".$from."</i></p>\n";ec… color='red'>Subject:</font><font color='white'><i>".$subject."</i></p>\n"… color='red'>Message:</font>\n";echo"<b>"… } else { echo"<font color='red'><h1>Email sending failed!</h1>\n";echo"<p>Themail()functio… this is my mailer php script and its working but in place of from ,receiver is getting only @ symbol instead of getting sender email address.why is this problem occuring please help me.
-
Answer:
Some servers are configured to NOT allow you to change the from header of an email. In an attempt to dissuade SPAM and spoofing emails. Or your misformed headers are the problem. $headers .= "From: " . $from . '<' . $from . '>' . PHP_EOL; Note the space after 'From:' Cheers, Gitlez
Sangita at Yahoo! Answers Visit the source
Other answers
Why are you using constants instead of strings? Replace all the constants with strings and that should solve some of your problems... (i.e. change $_GET[fake] to $_GET['fake']; change $_GET[header] to $_GET['header']; etc.)
JJ
Related Q & A:
- What's wrong with this PHP Twitter API POST?Best solution by Stack Overflow
- Whats wrong with my msn?Best solution by Yahoo! Answers
- How to start creating a php script, that will be installed on many servers?Best solution by Stack Overflow
- Whats wrong with my TI-84 calculator?Best solution by Yahoo! Answers
- Whats wrong with my lawn mower?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.