Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 21st, 2005, 01:05 AM
number1.email@gmail.com
Guest
 
Posts: n/a
Default php email problem

I have tried the following code:

FileName: index2.php
---------------------------------

<?
mail( "aaa@yahoo.com", "A", "B", "From: a...@aol.com" );
echo "Finished Emailing.";
?>

For some reason I don't get an email in my aaa@yahoo.com account, but
the message "Finished Emailing" does display. Seems pretty
simple...but it doesn't work. Can someone help me figure out what is
wrong...or the best way to debug this? thanks...

  #2  
Old December 21st, 2005, 02:15 AM
Juliette
Guest
 
Posts: n/a
Default Re: php email problem

number1.email@gmail.com wrote:[color=blue]
> I have tried the following code:
>
> FileName: index2.php
> ---------------------------------
>
> <?
> mail( "aaa@yahoo.com", "A", "B", "From: a...@aol.com" );
> echo "Finished Emailing.";
> ?>
>
> For some reason I don't get an email in my aaa@yahoo.com account, but
> the message "Finished Emailing" does display. Seems pretty
> simple...but it doesn't work. Can someone help me figure out what is
> wrong...or the best way to debug this? thanks...
>[/color]


The way you've set the test up, the 'finished emailing' message will
always show up, so it's no real test at all.

Try this instead and look at the result

if( mail( "aaa@yahoo.com", "A", "B", "From: a...@aol.com" ) ) {
echo 'Finished Emailing.';
}
else {
echo 'Sending mail failed';
}

If the message got send, try checking your Yahoo spam box - the message
might be filtered to it.

If the message sending failed, look at the error messages or warnings.
If none display, put the following line above the test:

error_reporting( E_ALL );

For more info, start reading: http://www.php.net/manual/en/function.mail.php
  #3  
Old December 21st, 2005, 10:55 AM
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
Default Re: php email problem

number1.email@gmail.com wrote:
<snip>[color=blue]
> For some reason I don't get an email in my aaa@yahoo.com account, but
> the message "Finished Emailing" does display. Seems pretty
> simple...but it doesn't work. Can someone help me figure out what is
> wrong...or the best way to debug this? thanks...[/color]

IIRC, there is a bug in PHP and it's yet to be fixed. If the mail
server is too sensitive, it won't accept stating "syntax error" or so.
Yahoo! server seems to be so sensitive; try gmail instead.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

  #4  
Old December 21st, 2005, 01:05 PM
number1.email@gmail.com
Guest
 
Posts: n/a
Default Re: php email problem

Thanks guys...alas, nothing seems to work. I've tried the following
code:

<?
error_reporting( E_ALL );

if( mail( "number1.email@gmail.com", "A", "B", "From: abc@aol.com" ) )
{
echo 'php - Finished Emailing.';
}
else {
echo 'php - Sending mail failed';
}
?>

And I still don't get an email. Not sure what to think...is there any
other "mail" option I have for my HTML / PHP bases Web Site?

  #5  
Old December 21st, 2005, 10:35 PM
Juliette
Guest
 
Posts: n/a
Default Re: php email problem

number1.email@gmail.com wrote:[color=blue]
> Thanks guys...alas, nothing seems to work. I've tried the following
> code:
>
> <?
> error_reporting( E_ALL );
>
> if( mail( "number1.email@gmail.com", "A", "B", "From: abc@aol.com" ) )
> {
> echo 'php - Finished Emailing.';
> }
> else {
> echo 'php - Sending mail failed';
> }
> ?>
>
> And I still don't get an email. Not sure what to think...is there any
> other "mail" option I have for my HTML / PHP bases Web Site?
>[/color]

You could have a look at this fully featured open source class:
http://phpmailer.sourceforge.net/

They may have figured out ways to get round the bug mentioned by Rajesh.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles