Hello I am sending mail from php. I am fetching to address and cc address from database and storing them in one one variable. $to,$cc i need to use this in mailx command. Following query is hardcoded and its working.
exec('echo "hey i am there" | mailx -S smtp=10.0.8.8:25 -r [email protected] -s "Alert" [email protected]');
Need to replace
$message = hey i am there
[email protected]
$from [email protected]
$subject = Alert
exec('echo $message | mailx -S smtp=10.0.8.8:25 -r $from -s $subject $to');
But the above thing is not working
'to"likeexec("echo $message | mailx -S smtp=10.0.8.8:25 -r $from -s $subject $to");