0

I'm trying to send email via php mail function like below but it doesn't seem to work on IE. It works on all other browsers. Below is the code. Is there a reason why???

$sent1 = mail($to, $subject, $message, $headers);
$sent2 = mail($clientTo, $clientSubject, $clientMessage, $clientHeaders);
if ($sent1 && $sent2){
                    $ch = curl_init("https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8");
                    curl_setopt($ch, CURLOPT_POST, 1);
                    curl_setopt($ch, CURLOPT_POSTFIELDS, "oid=$sf_oid&first_name=$sf_first_name&last_name=$sf_last_name&company=$sf_company&phone=$sf_phone&email=$sf_email&URL=$sf_website&description=$sf_description&lead_source=$sf_leadsource");
                    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
                    curl_exec($ch);
                    $info = curl_getinfo($ch);
                    if($_SERVER['REMOTE_ADDR'] == "124.254.75.167")
                        //print_r($info);
                    curl_close($ch);

                    $ch = curl_init("http://www.rankreport.com.au/ajax/add_new_lead");
                    curl_setopt($ch, CURLOPT_POST, 1);
                    curl_setopt($ch, CURLOPT_POSTFIELDS, "lead_company_id=1&lead_business=1234&lead_first_name=asdf&lead_website=12314.com&lead_phone=1234&lead_email=test@test.com&lead_package=seo");
                    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
                    curl_exec($ch);
                    curl_close($ch);

                    echo '3';
                }
Jae Kun Choi
  • 2,011
  • 5
  • 25
  • 32
  • This is server-side, there is no mention in this code of how you are getting parameters in to the code from the browser. So from what you have written is browser independent. **How** does it not work, what is going wrong? – Orbling Sep 09 '11 at 14:16
  • The mail function is working ok in all other browsers. The post is done via ajax to php file which the above code belongs to – Jae Kun Choi Sep 09 '11 at 14:20
  • Yes, I understand that - but whatever code makes it work with the others, is not displayed above. The parameters passed to the script are not mentioned above, so the error is before this. – Orbling Sep 09 '11 at 15:39

1 Answers1

2

PHP has nothing to do with browser (PHP is server-side executable), so it isn't browser's problem. You have probably no $sent1, $sent2 defined

genesis
  • 50,477
  • 20
  • 96
  • 125