i am using PHPMailer class to send email its work perfect however, my application requirement is such that I have to send email every hour by using task scheduling. Thats mean I have to use PHP.exe CLI. when I tried to execute from CLI my emailsender.php; its says unable to connect SMTP host.
I'm not sure if this will help, but it might.
I had the following problem:
WAMP server. Windows computer.
I run some code and at the end send alert email (all php) using PHPMailer. If I just run the PHP file, it works fine. When I used Task Scheduler, the email doesn't work.
I think this comes from the task scheduler using a different version of PHP on my computer than that of Apache when I load the page on the server.
I got around this by using an absolute file path to the PHPMailer class. It now works fine...
Hope this helps? I'm in no way a pro at this but it worked for me!
Rich
Related
We have a cron set up in Symfony 1.4 to send out several emails each morning. For some reason, today, it attempted to send via localhost rather than via the SMTP server we have configured in factories.yml. We don't have localhost on the production server so naturally this failed.
A couple new things that happened:
we actually replaced the cron yesterday with new code ... but the new code is using the same project / mailer configuration as the old one, so I don't see how this could cause a problem.
there are some new members on the team, from another company, and they have only recently gotten server access / started committing code. I can't see any changes made to factories.yml ...
Any idea what might be causing this? Any hints on where to search?
Try to clear your cache
php symfony cc
Hy !! i have a big problem, i have an Ubuntu 10.10 with php 5.3.2, I use phpmailer to send mails and the function works like a month ago. But know, it just said, SendEmail with the php mail, or with the phpmailer say's send!!!
The messages never arrived!! with the 2 functions, i dont know if the php.ini get moves , or somethings else.
All scripts were tested in other servers ( digital ocean ) and they work perfectly.
But know in this server, is not working.
The time I execute #linux: mail.php , its inmediatly, and send my message " SEND MESSAGE".
In Gmail, I already check if where at Spam , but they neever arrived.
No firewall, Ubuntu 10.10, phpmailer lasta version, php 5.3.2
i check with a Python Script with same configurarion in the same system and works!!!
but with php nothing works!
Please help!!
You need contact the digital ocean support and open a ticket. Same happened to me and I found that they have a block by default for new accounts (to avoid spammers). You need open a ticket ans inform your situation.
When I do this, minutes after they check some information and my mail start to work :)
I'm using email piping to parse messages and handle them appropriately in my app.
I'd like to figure out a way to test this locally on my Macbook Pro. I use MAMP for development.
Any ideas how I can send an email to my local machine that gets piped to a script?
Thanks!
If the thing you need to test is just a pipeline, yourscript <samplemessage.txt does the same thing.
unless you really want to install a mail server on your local machine, you can't. shouldn't really be hard to set up a test environment on your hosted site.
I need to send myself an automated email once a day from my windows XP dev. machine. I've got Apache, PHP, and MySQL running here. I don't mind which email address the email gets sent from since i can add it to my address bar. I'm wondering though, what do i need to enable/install to be able to send emails?
you can look into scheduled tasks that and commandline php. Commandline php lets you execute php files from the cmd for example php emailsend.php where you can use the mail() function. :)
You'll need some sort of mail transport agent - like sendmail. You could theoretically use a PHP library for sending email and have it relay to an SMTP server hosted somewhere else.
You can try using the swift mailer library
http://swiftmailer.org/
Check out BLAT:
You can set it up to run in a batch file and then use the Windows Task scheduler to execute the batch file at the specified time each day.
I'm running my own LAMP server locally.
Something i need to setup?
Should it be able to send email using php-mail,
without havin to configure smtp.
Check your phpinfo() information for STMP and the port. Do a test.php file and try to execute this.
mail('email#example.com', 'My Subject', 'Hello World');
http://drupal.org/node/11570
That thread will help you out.
Drupal basically patches into the php mail function, so as with that you either need a mail server installed locally with your lamp setup, or to point apache towards an external or smtp server in your php.ini file.
Ah fixed it, well i didn't-one of our developers did.
Apparently Drupal only uses 'Send Mail' so you have to have it installed, wont use php-mail.
For future reference/research:
try the Drupal module SMTP Authentication Support. I have yet to test it.