Re: mail function not working.no errors but mail was not sending

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you're not seeing any errors, then there's a good chance that it's  
one of these:
1. Error reporting is not turned on.
2. The mail service is blocked or not configured correctly.
3. The e-mail address that is receiving these is blocking the e-mail.

Have you tried sending a test e-mail without all of the code? i.e.  
just a php file with this in it:

mail('you@xxxxxxxxxxxxxx','Test subject','Test body');

Does that work?

Have you tried using PHPMailer and see if SMTP authentication does  
the trick?
--
Joe


On Aug 27, 2009, at 10:28 PM, sravani98_gogineni wrote:

> this is my code
>
> <?php
> $to = $_REQUEST['sendto'] ;
> $from = $_REQUEST['Email'] ;
> $name = $_REQUEST['Name'] ;
> $headers = "From: $from";
> $subject = "Web Contact Data";
>
> $fields = array();
> $fields{"Name"} = "Name";
> $fields{"Company"} = "Company";
> $fields{"Email"} = "Email";
> $fields{"Phone"} = "Phone";
> $fields{"list"} = "Mailing List";
> $fields{"Message"} = "Message";
>
> $body = "We have received the following information:\n\n"; foreach 
> ($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST 
> [$a]); }
>
> $headers2 = "From: noreply@xxxxxxxxxxxxxxx";
> $subject2 = "Thank you for contacting us";
> $autoreply = "Thank you for contacting us. Somebody will get back  
> to you as soon as possible, usualy within 48 hours. If you have any  
> more questions, please consult our website at www.oursite.com";
>
> if($from == '') {print "You have not entered an email, please go  
> back and try again";}
> else {
> if($name == '') {print "You have not entered a name, please go back  
> and try again";}
> else {
> $send = mail($to, $subject, $body, $headers);
> $send2 = mail($from, $subject2, $autoreply, $headers2);
> if($send)
> {
> print "yes done";
> }
> else
> {print "We encountered an error sending your mail, please notify  
> webmaster@xxxxxxxxxxxxxxx"; }
> }
> }
> ?>
>
> <form method="post" action="contact.php">
> <table bgcolor=#ffffcc align=center>
> <tr><td colspan=2><strong>Send Friend request</strong></td></tr>
> <tr><td>Friend's mail id</td><td><input type="text" name="sendto"></ 
> td></tr>
> <tr><td><font color=red>*</font>Your Name:</td><td><input size=25  
> name="Name"></td></tr>
> <tr><td><font color=red>*</font>Your Email:</td><td><input size=25  
> name="Email"></td></tr>
> <tr><td colspan=2>Message:</td></tr>
> <tr><td colspan=2 align=center><textarea name="Message" rows=5  
> cols=35></textarea></td></tr>
> <tr><td colspan=2 align=center><input type=submit name="send"  
> value="Submit"></td></tr>
> <tr><td colspan=2 align=center><small>A <font color=red>*</font>  
> indicates a field is required</small></td></tr>
> </table>
> </form>
>
>
> 



[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux