I am attempting to send mail out to my users when they register for an account, need a new password, etc. but I keep getting the "Error: it was not possible to send e-mail message". This appears to be my problem:
I take the test_email_message.php file, and upload it to my server along with the required include. I edit only the $to_address=""; and change it to my email address. I then try to send the mail. It works, I get the mail.
Then I change the $from_address= to:
It then gives me the error, and I don't get the mail. I've run many tests and it appears that if the $from_address= is set to "email@example.com" it will not work. Other variations of it will work fine, such as "firstname.lastname@example.org" or "email@example.com" or "firstname.lastname@example.org" or even "email@example.com".
It just seems to have a problem with that one trailing l all the time. If anyone can offer a solution that would be great. Thanks!
P.S.. I attempted to post this issue at the Google group- twice. But no matter what it would say "your post will appear momentarily" and then it would never show... unless I am completely blind and it is there.
Manuel Lemos - 2007-07-06 20:57:14 - In reply to message 1 from Robert M
It seems that the PHP mail() function, used by the base class, is not working on your environment for some reason. Maybe you are not allowed to send messages to external servers due to some misconfiguration.
Can you send messages via an SMTP server? If so, you can use the smtp_message_class that is the sub-class of the email_message_class . It uses an SMTP server to relay messages instead of the mail() function.
The usage is almost the same, apart from some variable settings to specify the SMTP server details. Take a look at the test_smtp_message.php script to see an example.
Robert M - 2007-07-06 21:39:35 - In reply to message 2 from Manuel Lemos
Thanks for the response.
I don't think that is the case (with the external servers), as I can send emails to my hotmail address, or my ISP email address from my webhost.
The SMTP server is the same problem, I tried it doing the same thing- copying the test file onto my server and only changing the to_address then sending. It worked. So then I changed the from_address (or the address that I want the emails to reply to) and that is when it stopped working.
It only seems to be a problem when I use firstname.lastname@example.org as the FROM address. Everything else will work; email@example.com, firstname.lastname@example.org, @afrika.com, @afrikacenteradfgsdfg.com will all work.
(And by work, I mean I will get the email in my external mail server and the from_address (the reply address) will be one of the above.)
P.S. I noticed that my post from last night appeared on Google- looks like they are slow with there postings.
Robert M - 2007-07-06 23:28:12 - In reply to message 4 from Manuel Lemos
Good idea. *runs off and does the test* Okay, here we go:
Resolving SMTP server domain "localhost"...
Connecting to host address "127.0.0.1" port 25...
Connected to SMTP server "localhost".
S 220-*******.bluehost.com ESMTP Exim 4.66 #1 Fri, 06 Jul 2007 17:24:32 -0600
S 220-We do not authorize the use of this system to transport unsolicited,
S 220 and/or bulk e-mail.
C EHLO localhost
S 250-*******.bluehost.com Hello localhost [127.0.0.1]
S 250-SIZE 52428800
S 250-AUTH PLAIN LOGIN
S 250 HELP
C MAIL FROM:<email@example.com>
C RCPT TO:<USER@ISP> /* I've changed this line, it is pointing to a valid email addr.. */
S 250 OK
S 550-Verification failed for <firstname.lastname@example.org>
Error: 550-Verification failed for
Manuel Lemos - 2007-09-23 06:54:17 - In reply to message 7 from ron
Sure, just take a look at the HTML sending example scripts like test_simple_html_mail_message.php or test_html_mail_message.php . Those use the base class email_message_class.
You can send messages via SMTP using the smtp_message_class instead email_message_class. For that you need to include also the classes smtp_message.php, smtp.php and sasl.php if you need to authenticate.
You also need to set some class variables to configure the SMTP server host and authentication credentials. Take a look at the test_smtp_message.php for examples.