I have a complicated problem here..I have codes to send mail using PEAR which i have tested in a php page called testmail.php. Now i have my actual application an a page called Cart.php where i have a button called Place Order. When i click on this button, it actually redirects to a url called : http://localhost/final/index.php?OrderSuccessful which actually displays a message on the page and sends an email. The problem is that when i put the code for email in Cart.php, i get errors. But when i put the url http://localhost/final/testmail.php it actually works. So i was thinking, is there a way to execute the codes from that testmail.php by remaining on the page Cart.php?
include('Mail.php');
$mail = Mail::factory("mail");
$开发者_运维百科headers = array("From"=>"xyz@gmail.com", "Subject"=>"Your order has been placed ");
$body = "lol";
$mail->send("abc@live.com", $headers, $body);
I get the error
Assigning the return value of new by reference is deprecated
Seems like you have old code. Follow the tips here:
ERRNO: 8192 when trying to send mail
精彩评论