September 8, 201016 yr Hi Guys, Hopefully this will be something simple. Ive written a nice little contact form using php to process it, everything seems to be working brilliantly except for one little thing. When i receive an email from my form in outlook, the from field says "anonymous". When i open up the email the address is an anonymous@random-numbers.domain.com type. Is there anything i can put in my php script to correct this as i don't have access to my 'php.ini'. Thanks in advance.
September 8, 201016 yr Add a from header... e.g <?php //From: Web Master <webmaster@example.com> mail('me@mydomain.com', 'Test message', 'Hello World', 'From: Web Master <webmaster@example.com>'); ?> You can read up on RFC2822 standard mail headers at http://www.faqs.org/rfcs/rfc2822.html Section 3.6 Field definitions.
September 8, 201016 yr Author Hi jock, Thanks for the reply, i feel a little silly with this one because i managed to get it to work and it was such a simple thing. '$from = "webmaster@domain.com"' Completely missed that line. Maybe i should read a few books eh??
Create an account or sign in to comment