www.webdeveloper.com
Results 1 to 4 of 4

Thread: mail() function not mailing.

  1. #1
    Join Date
    Mar 2009
    Location
    Fortaleza, CE, Brazil
    Posts
    81

    mail() function not mailing.

    Hello there, dudes!!

    Well, I've got a problem: I'm using a form to send emails to a mailbox using mail(), but they're not arriving.

    I'm sure that the mailbox exists, and that the function mail() returns true, that is, the e-mail was supposedly sent. Also, if I use my gmail account as addressee, the message arrives normally.

    Do you have any idea of why it's not arriving?

    Though I think it's irrelevant, here's the code, take a look:
    PHP Code:
    <?php
     
    if(mail($para,"Talk to Us - $nome",$msg,$headers)){
           @
    mail($email,"Talk to Us - $nome_cliente",$msg2,$headers2);
           
    ?>
           <script>
                alert('<?php echo $nome ;?>, your message was sent.');
                location.href='http://www.bioseiva.com.br';
           </script>
           <?php
     
    }else{ ?>
           <script>
                alert('<?php echo $nome ;?>, sorry, your message could not be sent.');
                location.href='http://www.bioseiva.com.br';
           </script>
     <?php
     
    ?>
    Thanks.
    Last edited by Granite; 04-28-2009 at 08:19 AM.

  2. #2
    Join Date
    Jul 2006
    Posts
    77
    I seem to be having a similar problem so if somebody could help us both that would be great.

    I have form information written to a DB and e-mailed to me. Both always worked in the past but about a month ago I stopped getting the e-mails. It still puts the information into the DB. I didn't change any code so I'm not sure what's wrong. Here it is anyway:

    Code:
    <?
    	include("connect.php");
    
    	$name=$_POST['vName'];
    	$email=$_POST['vEmail'];
    	$site=$_POST['vSite'];
    	$inq=$_POST['vInq'];
    	$comments=$_POST['vComment'];
    	
    	mysql_query("INSERT INTO contacts
    	(name, email, site, inq, comments) VALUES('$name', '$email', '$site', '$inq', '$comments') ") 
    	or die(mysql_error());  
    	
    	$msg = "A new entry has been added to your form";
    	$msg .= "\n-----------------------------------\n"; 
    	$msg .= "Name: $name\n"; 
    	$msg .= "Email: $email\n"; 
    	$msg .= "Website: $site\n";
    	$msg .= "Reason: $inq\n"; 
    	$msg .= "Comment: $comments\n";
    	
    	mail ("myemail@gmail.com", "New Entry", $msg); 
    
    ?>

  3. #3
    Join Date
    Feb 2009
    Posts
    162
    Try to on Check Which PHP Error you are getting when you are tying to send the email.

    try if(mail()) and then try to cath the error number


    LG GC 900 Viewty 2 exposed

  4. #4
    Join Date
    Jan 2009
    Posts
    3,346
    You can also check to see if the sending email server has been blacklisted. Some freemail accounts (hotmail, yahoo, etc) automatically block incoming emails originating from dynamic IP blocks or those identified as spammers in spam block lists.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles