I have a form on my page. When the user clicks the "Submit" button, he must send an email with the data that he entered into the form. Until recently, the form was hosted on a Linux server, and I had no problems with it - mail was sent and received. I recently had to switch to a shared Windows server, and no mail has been sent since the move. Here is the code that should send the mail:
function send_contact_form($strName, $strEmail, $strPhone, $strMessage) { $to = ' mymail@mysite.com '; $subject = 'From the site'; $message = '<html lang="HE"> <head> <title> '.$subject.' </title> </head> <body style="text-align:right; direction:rtl; font-family: Arial;"> Name: '.$strName.'<br>Email: ' .$strEmail.'<br>Phone: '.$strPhone .'<br><br>Message: <br>'.$strMessage.' </body> </html>'; $email = $strEmail; $header = 'MIME-Version: 1.0' . "\r\n"; $header .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; $header .= "From: $email\r\nReply-To: $email" . "\r\n"; mail($to, $subject, $message, $header); }
source share