473,326 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

php email problem

I have tried the following code:

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

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

For some reason I don't get an email in my aa*@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...

Dec 21 '05 #1
4 1528
nu***********@gmail.com wrote:
I have tried the following code:

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

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

For some reason I don't get an email in my aa*@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...

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( "aa*@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
Dec 21 '05 #2
nu***********@gmail.com wrote:
<snip>
For some reason I don't get an email in my aa*@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...


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/

Dec 21 '05 #3
Thanks guys...alas, nothing seems to work. I've tried the following
code:

<?
error_reporting( E_ALL );

if( mail( "nu***********@gmail.com", "A", "B", "From: ab*@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?

Dec 21 '05 #4
nu***********@gmail.com wrote:
Thanks guys...alas, nothing seems to work. I've tried the following
code:

<?
error_reporting( E_ALL );

if( mail( "nu***********@gmail.com", "A", "B", "From: ab*@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?


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.
Dec 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jpastora | last post by:
I'm having a strange problem with our email links on the domain : http://www.pc350.com/ . The problem is that when you click on an email link, the email app is not launched until the browser...
6
by: mike | last post by:
I have created a side application in VB.NET which reads rows from a DB and builds an email message. when i have a long string the the mailmessage.body or the mailmessage, it puts in an...
88
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
0
by: VP | last post by:
g'day, i am posting a problem i have encountered with creating an email using outlook through some basic c# code. the problem arises when using different email editors in outlook. At the moment...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
26
by: libsfan01 | last post by:
Hi all! Can anyone show me how to check and email field on a form for the existence of these two characters. Kind regards Marc
0
by: RickVidallon | last post by:
Missing or Truncated Body Text in Email Application - 2 Strange Examples... There is no earthly reason why this is happening! EXAMPLES HERE: http://65.36.227.70/actmailer/ We have a...
3
by: Steven Allport | last post by:
I am working on processing eml email message using the email module (python 2.5), on files exported from an Outlook PST file, to extract the composite parts of the email. In most instances this...
3
by: IGD | last post by:
I don't know if this is the right place to post this or not. If not, could someone direct me elsewhere where I would find more information on how to solve my problem? Thanks! My problem is this:...
28
tdw
by: tdw | last post by:
Hi all, I am trying to add a feature to our database that automates sending emails. When entering a new order, I want the option to send an email to the company the order came from, attaching a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.