문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top