sending emails through mail()

prabhu89

New Member
Messages
2
Reaction score
0
Points
0
Hi,
I want users to send me mails using the contact page on my site and this is my send_email.php code

<html>
<head>
<title></title>
</head>
<body>
<?php
$email_to = 'www.*******@gmail.com';
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$headers = "From: $email\r\n";

if(mail($email_to,$subject, $message, $headers)){
echo 'sent ';
}else{
echo 'failed';
}
?>
</body>
</html>

Even though i get a message saying "sent" i am unable to see the mail either in my inbox nor in my spam folder please guide me through as m a total noob
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
If your script is running on Free Hosting here, the only addresses you are allowed to send from are valid email accounts associated with your hosting account. You can set the reply-to to something else, but from needs to be your own account, or it will be silently discarded as outgoing spam.
 

prabhu89

New Member
Messages
2
Reaction score
0
Points
0
I followed up with an email linked to my hosting account but this is is what what i got


Hi. This is the qmail-send program at outgoing.x10hosting.com.I'm afraid I wasn't able to deliver your message to the following addresses.This is a permanent error; I've given up. Sorry it didn't work out.<www.massminds123@gmail.com>:209.85.225.26 does not like recipient.Remote host said: 550-5.1.1 The email account that you tried to reach does not exist. Please try550-5.1.1 double-checking the recipient's email address for typos or550-5.1.1 unnecessary spaces. Learn more at550 5.1.1 http://support.google.com/mail/bin/answer.py?answer=6596 uj7si631075igb.72Giving up on 209.85.225.26.--- Below this line is a copy of the message.Return-Path: <prabhu89@chopin.x10hosting.com>Received: (qmail 3249 invoked by uid 508); 3 May 2012 10:04:21 -0000Received: from edge.x10labs.com by outgoing.x10hosting.com (envelope-from <prabhu89@chopin.x10hosting.com>, uid 507) with qmail-scanner-2.08st (clamdscan: 0.97/14872. spamassassin: 3.3.1. perlscan: 2.08st. Clear:RC:1(96.127.188.42):SA:0(2.4/2.8):. Processed in 5.497883 secs); 03 May 2012 10:04:21 -0000X-Spam-Status: No, hits=2.4 required=2.8X-Spam-Level: ++Received: from edge.x10labs.com (HELO localhost) (96.127.188.42) by outgoing.x10hosting.com with SMTP; 3 May 2012 10:04:15 -0000X-Virus-Scanned: amavisd-new at edge.x10labs.comReceived: from edge.x10labs.com ([127.0.0.1]) by localhost (edge.x10labs.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HgQBCYpTQcC5 for <www.massminds123@gmail.com>; Thu, 3 May 2012 06:04:09 -0400 (EDT)Received: from chopin.x10hosting.com (chopin.x10hosting.com [69.175.104.34]) by edge.x10labs.com (Postfix) with ESMTP for <www.massminds123@gmail.com>; Thu, 3 May 2012 06:04:09 -0400 (EDT)Received: from chopin ([127.0.0.1] helo=chopin.x10hosting.com) by chopin.x10hosting.com with smtp (Exim 4.69) (envelope-from <prabhu89@chopin.x10hosting.com>) id 1SPstN-0003yc-5C for www.massminds123@gmail.com; Thu, 03 May 2012 06:04:09 -0400Date: Thu, 03 May 2012 06:04:09 -0400X-SG-User: prabhu89X-SG-Opt: PWD=/home/prabhu89/public_html/massminds To: www.massminds123@gmail.comSubject: hiX-PHP-Originating-Script: 20836:send_email.phpFrom: prabhu89@chopin.x10hosting.comX-ACL-Warn: {X-AntiAbuse: This header was added to track abuse, please include it with any abuse reportX-AntiAbuse: Primary Hostname - chopin.x10hosting.comX-AntiAbuse: Original Domain - gmail.comX-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]X-AntiAbuse: Sender Address Domain - chopin.x10hosting.comX-Source: X-Source-Args: X-Source-Dir: Message-ID: <133603945510213240@outgoing.x10hosting.com>mail successfully delivered

---------- Post added at 10:22 AM ---------- Previous post was at 10:17 AM ----------

http://pastebin.com/kLbB8xXt

---------- Post added at 10:30 AM ---------- Previous post was at 10:22 AM ----------

mail delivered successful,thanks a ton,was being paranoid:tongue:
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Please use
PHP:
, [html] or [code] tags (as appropriate) to separate and format code. As [pre] isn't supported in the X10 forums, you can use [code] for non-code text to preserve formatting .
 
Top