5

我建立了一个使用 PHP mail() 的网站。如果我在 http:// 上点击脚本,我可以让它成功运行,但如果我切换到 https://,它就不起作用!我使用 Godaddy 进行托管,并通过他们购买了证书。我不确定是否需要在 php.ini 文件中设置任何内容。我的邮件脚本如下所示:

$from_respondent_email = "calendar@mydomain.com" ;
$headers_respondent_email = "From: $from_respondent_email"; 
$subject_respondent_email = "Technical Support Request"; 
$body_respondent_email = "We received a support ticket from mydomain.com:\n\n"; 
$body_respondent_email .= "Test block of text"; 
$send = mail("myname@gmail.com", $subject_respondent_email, $body_respondent_email, $headers_respondent_email); 
4

1 回答 1

0
$to ="myname@gmail.com";
$subject = "Technical Support Request";
$message = "We received a support ticket from mydomain.com:\n\n";
$from = "calendar@mydomain.com";
$headers = "From: $from_respondent_email";
mail($to,$subject,$message,$headers);

尝试这个。它会工作的。我在我的网站及其工作中使用了它:)

于 2013-07-20T20:26:55.633 回答