Jump to content

PHP Form variable 'from' field


lou28

Recommended Posts

Hi I'm a beginner with php and I had created a simple php form processing script as below, but the hosting company I use has just told me..

 

We have recently tightened up the spam controls on our webservers so your script needs to specify a valid mailbox as the postmaster otherwise it would be sent as [email protected] which is then blocked.

you need to make sure you have a -f argument followed by the mailbox specified in your coding.

 

They weren't any more help than that so I'm not sure what this means!

Can anyone enlighten me!?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/127386-php-form-variable-from-field/
Share on other sites

Sorry forgot to include the code.

 

Yes it is a mailing form:

 

<?php

// Pick up the form data and assign it to variables

$name = $_POST['name'];

$email = $_POST['email'];

$comments = $_POST['message'];

 

// Build the email (replace the address in the $to section with your own)

$to = '[email protected]';

$subject = "website enquiry";

$comments = "$name said: $comments";

$headers = "From: $email";

 

// Send the mail using PHPs mail() function

mail($to, $subject, $comments, $headers);

 

// Redirect

header("Location: contact2.html");

?>

Archived

This topic is now archived and is closed to further replies.

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