Question

I have this bit of code:

$to = "igoralves@hotmail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
mail($to,$subject,$message,"From: $from");

I am hosted on ipage. The service does not work. So they told me that: " "There is no need to manage any changes on php.ini file. Please use the SendMail path - /usr/sbin/sendmail in your script."

How can I change the code? thanks

Was it helpful?

Solution

Don't know if is still useful for you, but in order to send email from ipage using php you need to set the "From: " field in the mail function as 'From: /usr/sbin/sendmail'."\r\n".

So in your case the variable $from would be $from = 'From: /usr/sbin/sendmail'."\r\n"

I myself tried this code and it fixed the problem.

Best regards.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top