Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 05-31-2010, 11:46 PM
refilltuffy refilltuffy is offline
Junior Member
 
Join Date: 05-31-10
Posts: 1
iTrader: 0 / 0%
How to check whether the mail has been successfully send using mail function in php?

please any one tell me...........Thanks
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 06-01-2010, 12:01 AM
gullsinn gullsinn is offline
Banned
 
Join Date: 06-10-07
Posts: 167
iTrader: 1 / 100%
Go to your hosting mail box and check if it is not rejected
and check your Hosting IP address if it is not marked as spamm
if your IP is safe from Spamm assign be sure your Mail is delivered
 
Reply With Quote
  #3  
Old 06-01-2010, 12:08 AM
HTMLBasicTutor's Avatar
HTMLBasicTutor HTMLBasicTutor is offline
Administrator
 
Join Date: 10-29-07
Location: Canada
Posts: 26,656
iTrader: 5 / 100%
Send it to yourself at another email address.
 
Reply With Quote
  #4  
Old 06-01-2010, 07:49 AM
trevHCS trevHCS is offline
Contributing Member
 
Join Date: 10-14-03
Location: Top left of England, UK
Posts: 169
iTrader: 0 / 0%
The only way really is to check the return value of mail() which will either be true for sent or false for failed. This doesn't tell you if the mail left the server necessarily as it'll likely be queued for the MTA (mail transport agent) to deliver it.

Code:
if (!mail('me@example.com', 'Subject', 'Body')) { echo "Summut went wrong with sending"; }
Sometimes I've found this will tell you if the recipient isn't valid, but it really does depend on how the MTA is setup and whether it's free to send the emails at that point.

Beyond that you'd need to start messing with sending the mails directly which might cause all kinds of hassles and on a lot of servers you simply can't bypass the MTA for security reasons.

Trev
 
Reply With Quote
  #5  
Old 06-04-2010, 09:06 AM
AgniHost AgniHost is offline
Junior Member
 
Join Date: 06-04-10
Posts: 9
iTrader: 0 / 0%
Send the mail to your self.

Also use if conditions as Trev mention with an example!
 
Reply With Quote
  #6  
Old 06-07-2010, 03:35 PM
Pollux's Avatar
Pollux Pollux is offline
Junior Member
 
Join Date: 05-31-10
Location: Bulgaria
Posts: 9
iTrader: 0 / 0%
The right way to check whether mail function sedn mail right is to check response of action :

PHP Code:
(!mail('me@example.com''Subject''Body')) { 
  echo 
"Summut went wrong with sending";

,but that isn't meaning the mail is received from recipient.
If you want to be a sure about that the email is received you have to do tracking email for open/read!
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
my Outlook won't send e-mail shahab6 Tech Talk 7 09-03-2009 01:46 PM
the mail() function and the arguments i used gives me a critical error. Please help~~ 2939195631902 Coding Forum 7 02-08-2009 05:58 PM
qmail does not send e-mail keko Dedicated Servers 1 06-23-2006 12:09 AM
need help: trouble with mail function.... cuongdm Coding Forum 3 12-25-2005 10:49 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 03:25 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC