Boss asked me to implement a php asynchronous mail function. I found the information on the internet and found that I could use popen. so I initially wrote the following code: {code ...} this script is an account that uses phpmailer to send an email to me. Now you want to pass a parameter to this function: $ to -- recipient $ content... the boss asked me to implement a php asynchronous mail function. I found the information on the internet and found that I could use popen. so I wrote it as follows:
pclose(popen("php -f mymail.php","r"));
This script is an account that uses phpmailer to send an email to me.
Now you want to pass parameters to this function:
$ To -- recipient
$ Content -- content
$ Subject -- title.
These are essential for sending an email,
But I don't know how to write it?
Is this command followed by a parameter? As shown below, = may be a reliable point
php -f mymail.php -a $argv1 -b $argv2
Or is there something that can pass parameters? (But none of the four parameters of the popen function can be found)
Popen ("balabala", "r", $ parameter, $ parameter)
Or do you want to forcibly write it in and then use it directly? Similar to the following:
fopen("mymail.php","w");fwrite $to balabala;fwrite $subject balabala;fclose(fopen(balabala));
For php beginners, I am sorry for any issues. please kindly advise, =
Reply content:
The boss asked me to implement a php asynchronous mail function. I found the information on the internet and found that I could use popen. so I wrote it as follows:
pclose(popen("php -f mymail.php","r"));
This script is an account that uses phpmailer to send an email to me.
Now you want to pass parameters to this function:
$ To -- recipient
$ Content -- content
$ Subject -- title.
These are essential for sending an email,
But I don't know how to write it?
Is this command followed by a parameter? As shown below, = may be a reliable point
php -f mymail.php -a $argv1 -b $argv2
Or is there something that can pass parameters? (But none of the four parameters of the popen function can be found)
Popen ("balabala", "r", $ parameter, $ parameter)
Or do you want to forcibly write it in and then use it directly? Similar to the following:
fopen("mymail.php","w");fwrite $to balabala;fwrite $subject balabala;fclose(fopen(balabala));
For php beginners, I am sorry for any issues. please kindly advise, =