Current location: Hot Scripts Forums » Programming Languages » PHP » mail() function


mail() function

Reply
  #1 (permalink)  
Old 07-24-03, 12:41 PM
SmartBiz SmartBiz is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
mail() function

Hello,

I need some help.

I need to know if there is a possibility for mail() function to not work sometimes.

What I mean is: in a script the members sometimes receive their emails, sometimes they don't. But the server is up.

Is all about the server settings?

Thank you for your help in advance!
__________________
<font size=1>
<a href="http://www.oscoders.biz"><font color="blue"><b>osCoders.biz</b></font></a> - Your premier source for professional <b>osCommerce templates</b>
<br>
<a href="http://www.smarttemplate.biz"><b>SmartTemplate.biz</b></a> - Your professional web template resource -- 10% off
</font>
Reply With Quote
  #2 (permalink)  
Old 07-24-03, 04:23 PM
Man Down Man Down is offline
HS Staff
 
Join Date: Jun 2003
Location: Maryland
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
If the mail function doesn't work sometimes and does others it could be a problem with your smtp server. Heres a basic way to check if your mail function is working. Just change my@address.com to your email address.

PHP Code:

<?

if (!mail('my@address.com''subject''message''headers') {
echo 
"Mail failed";
} else {
echo 
"Mail sent";
}
?>
__________________
Man Down
Reply With Quote
  #3 (permalink)  
Old 07-24-03, 04:27 PM
SmartBiz SmartBiz is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Yes. I checked in this way before and the results are the same ... Not worked all the time ...


Thank you very much,
__________________
<font size=1>
<a href="http://www.oscoders.biz"><font color="blue"><b>osCoders.biz</b></font></a> - Your premier source for professional <b>osCommerce templates</b>
<br>
<a href="http://www.smarttemplate.biz"><b>SmartTemplate.biz</b></a> - Your professional web template resource -- 10% off
</font>
Reply With Quote
  #4 (permalink)  
Old 07-25-03, 11:16 PM
paulj000 paulj000 is offline
Bull in a china shop
 
Join Date: Jul 2003
Location: California, USA
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
I was having similar problems on a server with mail() function. I was having an email sent to me everytime someone signed up for a newsletter and I was also having their form contents that they filled out written/appended to a text file.

I kept monitoring the text file and there would be new signups but I would only occassionally get the email also that the script was supposed to send. OF COURSE everytime I filled out the form to test it I recieved the email.... but not always when someone else filled out the form.

I quickly lost faith in the mail() function... at least on that server.
Reply With Quote
  #5 (permalink)  
Old 07-28-03, 07:17 AM
ivan's Avatar
ivan ivan is offline
Newbie Coder
 
Join Date: Jul 2003
Location: malang-indonesia
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
I have problem with mail() function.When i make a "contact us" form, such as :
-----------------------------
to : info@zxcvbnm.com
your name : asdfghjkl
your email : wer@asdfghjkl.com
message : 123 testing
----------------------------
when the sender click submit button,the message is "your mail is succesfully sent", but when i checked at the contact mail (info@zxcvbnm.com) there is no message from the sender. Can you help me, what possibly the mistake?
__________________
irfani_f@yahoo.com
irfani.ptmunibraw.org
Reply With Quote
  #6 (permalink)  
Old 07-28-03, 10:06 PM
Reoplex Reoplex is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
maybe if you post part of the script we can find out if there is something wrong with the coding.
Reply With Quote
  #7 (permalink)  
Old 08-03-03, 09:47 PM
ivan's Avatar
ivan ivan is offline
Newbie Coder
 
Join Date: Jul 2003
Location: malang-indonesia
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
hi reoplex, if my script (contact us script) I put in free hosting server (lycos), my script succesfull running, and i got the email
__________________
irfani_f@yahoo.com
irfani.ptmunibraw.org
Reply With Quote
  #8 (permalink)  
Old 08-03-03, 09:52 PM
ToolTip85's Avatar
ToolTip85 ToolTip85 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
i dont really like the mail() function it's buggy on some servers, i use MySQL instead combined with phpmyadmin to monitor forms/etc and lycos free server only allows 50 mails per day
__________________
Free Hosting The Way It Should Be: <a href="http://www.distanthost.com">Distanthost</a> 120mb 8GB :: <a href="http://www.breezeland.com">Breezeland</a> 100mb 6GB
Reply With Quote
  #9 (permalink)  
Old 08-03-03, 10:01 PM
ivan's Avatar
ivan ivan is offline
Newbie Coder
 
Join Date: Jul 2003
Location: malang-indonesia
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
hi all, this is my action script :
<?php
$emailto="info@xtremecafe.net";
$from = "From: $name <$email>";
$subject = "Contact XtremeCafe.net";
mail("$emailto", "$subject", "$name has made a contact for info@xtremecafe.net
\nTheir e-mail is $email
\n\nTheir Message :\n $message","$from");
header("Location: contact_thanks.php");
?>
Can you help me, what possibly the mistake?
__________________
irfani_f@yahoo.com
irfani.ptmunibraw.org
Reply With Quote
Reply

Bookmarks


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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i work with PHP mail() function darkcarnival PHP 5 08-31-09 05:11 PM
More frickin' table help H-a-V-o-C_88 HTML/XHTML/XML 1 09-14-03 07:04 PM
Help trim code down TheLaughingBandit JavaScript 0 09-02-03 09:50 AM
File Management, sorry i keep changing, this is the last one! :) Arctic ASP 28 08-29-03 12:04 AM
edit php in Squirrelmail jrcortrightiii PHP 1 07-10-03 02:08 PM


All times are GMT -5. The time now is 05:03 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.