php cannot invoke msmtp
I want to use php for mailing on linux.But when I do it with"$a=`msmtp firstname.lastname@example.org < /u1/ftp/mail.txt &`",it does not work.The mail.txt's contents are following:
This is a test mail.
Please pay attention to the two null lines.
I hope some answers.Thank you.
Hi and welcome to LQ,
Does msmtp works when invoked from CLI, like:
It does not work yet.
Thank you for your reply,#2.But it does not work yet .The .msmtprc's content is:
#Set default values for all following accounts
# Gmail service
# A freemail service
# A second mail address at the same freemail service
#account freemail2 : freemail
# The SMTP server of the provider.
# Set a default account
account default : gmail
Hope for help.
Also have a look at logs (~/Mail/msmtplog) to see if you find something.
I have tried to cancel the "#",but it does not work.When I change the code with "$a=`msmtp --help`;",it return the help.But it does not work with other commands.
Please define "it does not work"
I've already told you to do your tests from CLI, so you'll see eventual errors either on screen, or in the log file created
I can send a mail from CLI.A test code is following:
#! /u1/Php/php/bin/php -q
$b=`msmtp email@example.com < /u2/ftp/mail.txt &`;
This code works.
|All times are GMT -5. The time now is 07:28 PM.|