I could really use some help with this.
I have been coding in PHP for about 3 months now, and I've managed to put together some pretty fancy data driven web pages.
In my current work environment, I have never generated any mail messages via PHP.
I have been using Korn Shell and "mailx" for many years.
I have a need to generated email messages inside of my php code.
But, the environment that I'm in requires a mail aliasing entry for each message that I send.
Using "mailx", I would send a simple mail message using the following syntax:
cat $FILE | mailx -s"$(echo -e "PHP Test Message\nContent-Type: text/html")" "$DISTRO" -- -f SomeAddress@gmail.com
-OR-
echo "Something" | mailx -s"$(echo -e "PHP Test Message\nContent-Type: text/html")" "$DISTRO" -- -f SomeAddress@gmail.com
I never needed to add the "-- -f SomeAddress@gmail.com" until coming to this particular company.
But, if I do NOT add this snippet to the end of my mailx command, the messages will never leave the server.
I have been testing several different PHP mail entries, and I am NOT getting any errors, but the messages are just not being generated, or at least they are not leaving the server.
I am assuming that the issue is with this same exact snippet that I need to end my mailx commands with.
Can anyone tell me, or give me a sample mail command, that would include the above "-- -f SomeAddress@gmail.com" snippet?
Thanks in advance, and have a great day.
JCF
PHP - mail not sending - No errors visible
Moderator: General Moderators
Re: PHP - mail not sending - No errors visible
Take a look at mail() in the PHP manual.
Code: Select all
mail('nobody@example.com', 'the subject', 'the message', null, '-fwebmaster@example.com');Re: PHP - mail not sending - No errors visible
I tried the above, in each of the following formats:
'-femail@someisp.com'
'-f email@someisp.com'
'-- -femail@someisp.com'
'-- -f email@someisp.com'
I'm not getting any errors anywhere that I can see.
Is there some way to generate a logfile entry, or some type of flat file entry, that would show me exactly what values, what data, is being populated, or seen by the mail handler?
Is there some PHP logging function, that would allow me to log everything that this command is generating?
I already tried setting the default logging levels to their maximum, but no errors or logfile entries are being generated:
error_reporting(E_ALL);
TIA
JCF
'-femail@someisp.com'
'-f email@someisp.com'
'-- -femail@someisp.com'
'-- -f email@someisp.com'
I'm not getting any errors anywhere that I can see.
Is there some way to generate a logfile entry, or some type of flat file entry, that would show me exactly what values, what data, is being populated, or seen by the mail handler?
Is there some PHP logging function, that would allow me to log everything that this command is generating?
I already tried setting the default logging levels to their maximum, but no errors or logfile entries are being generated:
error_reporting(E_ALL);
TIA
JCF
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: PHP - mail not sending - No errors visible
What is the "-f" for? Just try 'webmaster@example.com'
(#10850)
Re: PHP - mail not sending - No errors visible
You could also try setting the From: header manually