/    Sign up×
Community /Pin to ProfileBookmark

Why Doesn’t The Mail Function Work??

hi every1..

would some1 plz help me out here, i’m using this code to send an e-mail:

[code=php]$recipient=’[email protected]’;
$subject=’hi’;
$msg=’msg’;
$email=’[email protected]’;
$mailheaders = “From: t$emailn”;
mail($recipient, $subject, $msg, $mailheaders);[/code]

why doesn’t it work, no errors show up and nothing is send..

to post a comment
PHP

8 Comments(s)

Copy linkTweet thisAlerts:
@SZeroauthorSep 01.2007 — any1 plz?? it's urgent, i know its right code but wut could be wrong?? i tried it on lycos server didn't work too..
Copy linkTweet thisAlerts:
@hastxSep 01.2007 — Just a stab, but try leaving the "t" out of the header and replace the "n" with rn
Copy linkTweet thisAlerts:
@SZeroauthorSep 01.2007 — still doesn't work
Copy linkTweet thisAlerts:
@YelgnidrocSep 01.2007 — Could be that your server is not correctly configured to send e-mail.
Copy linkTweet thisAlerts:
@hastxSep 01.2007 — see if th server really thinks it was sent.

[code=php]
if (mail($recipient, $subject, $msg, $mailheaders)){
echo "message sent";
}else{
echo "message failed";
}
[/code]


If the server thinks it was sent. then you may have another problem like spam filter, or blacklist.

You can also try turning on error reporting on the file.
Copy linkTweet thisAlerts:
@YelgnidrocSep 01.2007 — I had an issue with an old host whereby mail() returned true, but this only means that php has done it's bit, not that the mail has actually been despatched by sendmail or whatever.
Copy linkTweet thisAlerts:
@SZeroauthorSep 02.2007 — see if th server really thinks it was sent.

[code=php]
if (mail($recipient, $subject, $msg, $mailheaders)){
echo "message sent";
}else{
echo "message failed";
}
[/code]


If the server thinks it was sent. then you may have another problem like spam filter, or blacklist.

You can also try turning on error reporting on the file.[/QUOTE]


it says message failed ?



Could be that your server is not correctly configured to send e-mail.[/QUOTE]
how to do that???
Copy linkTweet thisAlerts:
@hastxSep 03.2007 — You'll probably need to submit a trouble report. If you dont own the server, you're not going to have access to the configs.
×

Success!

Help @SZero spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...