[56K WARN] Newbie At Mailing Via PHP?

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

guest
Forum Commoner
Posts: 25
Joined: Sat Nov 22, 2003 11:50 pm

Post by guest »

posted messages (on other subjects) there in the past.
never got a reply.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

then you may want to look at setting it up differently or using a different server set up all together .. as it appears no one here runs xampp, or the ones that may run it haven't had these problems...
guest
Forum Commoner
Posts: 25
Joined: Sat Nov 22, 2003 11:50 pm

Post by guest »

xampp, comes with aload of good features, perl, python, coccon and other php goodies.

And it means i do not have to doit the longway round 8)

If I Cant Get It Fixed, Then I Will Leave It Trying, But If The Mail Send Is Not Successfull, I Will Provide A MailTo Link

--------------------------------------------------------------

P.S : Is There Any Way, I Can Get It To Hide The Error Message - If There Is An Error In The Sending Process. But Continue Excution Of The Rest Of The Page?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the "error" you are getting is merely a warning. You can hide the warning by using an error control operator (@) in front of the mail() call. Note though, this will suppress all errors for that function from displaying.

Execution does not stop on a warning.
guest
Forum Commoner
Posts: 25
Joined: Sat Nov 22, 2003 11:50 pm

Post by guest »

so would this work

Code: Select all

$m = @mail(); // NOT INSERTED VARIABLES AS THIS IS AN EXAMPLE
if ($m) {
echo "Mail Was Sent";
}
else {
echo "Error Sending Mail, Click Here To Open Your Email Editor";
}
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

if (!@mail())
    exit('Failed');

echo 'succesful';
I think is a better approach at it..
Last edited by John Cartwright on Mon Feb 28, 2005 12:48 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm not answering something that should only take you a few seconds to test.. :?
guest
Forum Commoner
Posts: 25
Joined: Sat Nov 22, 2003 11:50 pm

Post by guest »

what i wanted to know, is would that return true if it worked or false if the mail wasn't sent.

I could not say that cause for me, it would always return false
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Do lycos actually provide your internet access?

SMTP relaying restrictions mean that the only way you can send emails from localhost is via the SMTP provided by your ISP.

So even though I don't use the email inbox provided by NTLWorld which is my ISP I still send all my emails through their SMTP server smtp.ntlworld.com even if they are from a @mydomain.com address.

If lycos is your ISP then that's all good and just ignore me ;-)

Seems to be quite a few ppl struggling with the ini configuration for the mail() function at the moment :)
Post Reply