mail() not sending mail...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dardsemail
Forum Contributor
Posts: 136
Joined: Thu Jun 03, 2004 9:02 pm

mail() not sending mail...

Post by dardsemail »

Hi,

I'm playing around with the mail() function and can't seem to get it to work.

Here's what I have so far and its not sending me a mail to my account:

Code: Select all

<?php
	mail("dardmail@cox.net","MySubject", "Line 1\nLine 2n\Line 3");
?>
I have been reading other threads and am wondering if I have to play around with headers etc... in order to make it work.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you may need to play around with headers indeed.. should also maybe check with your host as to what they require to send mail through the function.. or if they even allow it :)

your email provider may have blocked it as well.. so you may want to check the email account attached to the reply address set in your [php_man]phpinfo[/php_man]..
dardsemail
Forum Contributor
Posts: 136
Joined: Thu Jun 03, 2004 9:02 pm

Post by dardsemail »

Hi,

My hosting co. indicated that I can do it and I've asked them for the reply address.

I looked in my PHPinfo and can't find anything referring to a reply address. The closest I've come is the following:

sendmail_from
sendmail_path

I took at look at the headers on the mails coming into my account, but its stilll not working as I'm not 100% clear what I should be looking out for.

My hosting co has a script that they use, I'm going to see if they can send me a copy so that I can make the relevant changes and get my mail to work.

NEW CONTENT TO MESSAGE - Does anyone have any suggestions/thoughts on using 'sendmail' instead of mail(). I can seem to get it to work using 'sendmail'.

Thanks!
Post Reply