Mail () on https

I am setting up a site that uses PHP mail (). I can run it if I delete the script via http: //, but if I switch to https: // this will not work! I use Godaddy for hosting and have a certificate purchased through them. I'm not sure if I need to configure anything in the php.ini file or not. My zip code is as follows:

$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
source share
1 answer
 $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); 

Try it. It will work. I used this on my website and its work :)

0
source

Source: https://habr.com/ru/post/1492478/


All Articles