开发者

Execute codes in a different page but remain on the same actual php page

开发者 https://www.devze.com 2022-12-26 02:37 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消