Love this thing and have gotten it to work from CLI with ease. However, for the life of me i can't figure out how to get this thing to respond back properly when i launch it within PHP. For example:
From shell if i type the following i get back a response: "Mail sent successfully":
**root@Rooter:~#** mailsend -to test@gmail.com -from "My Name" -starttls -port 587 -smtp smtp.gmail.com -sub "My subject here" -user myemail@gmail.com -auth-plan -pass "mypass" -cs "us-ascii" -enc-type "7bit" -M "My body message here"
Message: My body message here
Mime type: text/plain
Disposition: inline
Encoding type: 7bit
Mail sent successfully
**root@Rooter:~#**
However, within a PHP script if i run the same line using the exec() function like the following, then nothing returns back and the PHP script is frozen (inifinitely waiting for a response to return):
<?php
@exec( 'mailsend -to test@gmail.com
-from "My Name"
-starttls -port 587
-smtp smtp.gmail.com
-sub "My subject here"
-user myemail@gmail.com
-auth-plan
-pass "mypass"
-cs "us-ascii"
-enc-type "7bit"
-M "My body message here',
$output,
$retCode
);
// This area is never reached because the above exec() call never finishes
Ideally, i would like it to return AFTER a message has sent so i can continue my script processing and ideally i would like to get back the results (in the above example i use exec's $output reference variable to see the text results so i can parse to find out if the message was sent successfully)
Love this thing and have gotten it to work from CLI with ease. However, for the life of me i can't figure out how to get this thing to respond back properly when i launch it within PHP. For example:
From shell if i type the following i get back a response: "Mail sent successfully":
However, within a PHP script if i run the same line using the exec() function like the following, then nothing returns back and the PHP script is frozen (inifinitely waiting for a response to return):
Ideally, i would like it to return AFTER a message has sent so i can continue my script processing and ideally i would like to get back the results (in the above example i use exec's $output reference variable to see the text results so i can parse to find out if the message was sent successfully)