• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

PHP Mailform - How to change "from"

G

gtowle

Guest
I'm using a PHP mail form with Flash. All works fine, but I'm wondering if and how I can change the from email address so that the auto reply email comes from the client rather than from [email protected].

Haven't been able to find any solutions. Thanks.
 
This may help

I am still a bit of noob when it comes to this area - esp considering i can't get my forms to deliver at the moment, but in my search for why I did find this:

http://kb.odin.com/en/1251

It may be what you are looking for.

Lawrence
 
Lawrence-

That worked. Thanks. I wish I could help you with your issue-I'm not a pro either. Best I can do is provide you with the form that I am using (it links with Flash swf, though) which works fine with Plesk 8.2. Maybe you can compare and figure something out. Here it is and good luck.

Code:
<?  

$adminaddress = "[email protected]"; 
$siteaddress ="www.anydomain.com"; 
$sitename = "[YourName]"; 

//No need to change anything below ... 
// Gets the date and time from your server
$date = date("m/d/Y H:i:s");

// Gets the IP Address
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);

// Gets the POST Headers - the Flash variables
$action = $HTTP_POST_VARS['action'] ;
$email = $HTTP_POST_VARS['email'] ;
$firstname = $HTTP_POST_VARS['firstname'] ;
$name = $HTTP_POST_VARS['name'] ;
$company = $HTTP_POST_VARS['company'] ;
$city = $HTTP_POST_VARS['city'] ;
$comments = $HTTP_POST_VARS['comments'] ;
putenv ("QMAILUSER=yourname");
putenv ("[email protected]");
putenv ("QMAILHOST=anydomain.com");
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain;charset=us-ascii\r\n";
$headers .= "From: yourname<[email protected]>";

// Process the form data!
// and send the information collected in the Flash form to Your nominated email address

if ($action == "send") {
	//
	mail ("$adminaddress","Info Request",
	"A visitor at YourName has left the following information\n
	Firstname: $firstname 
	Name: $name
	Company: $company
	City: $city 
	Email: $email\n
	The visitor commented:
	------------------------------
	$comments
	
	------------------------------
	Date/Time:  $date") ; 
	
	//This sends a confirmation to your visitor
	mail ("$email","Thank You for visiting YourName", 
	"Hello $firstname $name,\n
	We have received your inquiry and will reply shortly.  Thank you for your interest in YourName.\n
	Sincerely,
	YourName" );
	
	
	
	//Confirmation is sent back to the Flash form that the process is complete
	$sendresult = "Thank you. You will receive a confirmation email shortly.";
	$send_answer = "answer=";
	$send_answer .= rawurlencode($sendresult);
	echo $send_answer;
} //

?>
 
Back
Top