sandy1028 Posted August 8, 2007 Share Posted August 8, 2007 Hi, This form is to submit the query. How to send the information after submit to email id <form name="contactform" method="post" action="" onsubmit="return validate()"> <table width="75%" border="0"> <tr> <td>Name </td> <td> some code here </table> <input type="submit" name="submit" value="Submit Query"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/63854-mail/ Share on other sites More sharing options...
sandy1028 Posted August 8, 2007 Author Share Posted August 8, 2007 I am not able to send mail. What is wrong in the code <? $to="abc@xyz.in"; //correct email id given $message .= "First Name: " . $_GET['name'] . "\n"; $message .= "Address: " . $_GET['address'] . "\n"; $message .= "Email: " . $_GET['email'] . "\n"; $message .= "Query: " . $_GET['query'] . "\n"; $message .= "Joined the blah blah.....\n"; $message .= "send membership information asap"; $subject = 'Feedback from blah blah'; // build the message $messageheader = 'From: '.$_POST['name']."\n\n"; $messageheader .= 'Email: '.$_POST['email']."\n\n"; $message .= 'Comments: '.$_POST['message']; // send the email mail($to, $subject, $message. $messageheader); Quote Link to comment https://forums.phpfreaks.com/topic/63854-mail/#findComment-318272 Share on other sites More sharing options...
NArc0t1c Posted August 8, 2007 Share Posted August 8, 2007 Try: <?php //headers $messageheader = 'From: '.$_POST['name']."\n"; //To $to = "abc@xyz.in"; //correct email id given //Message $message = "First Name: " . $_GET['name'] . "\n"; $message .= "Address: " . $_GET['address'] . "\n"; $message .= "Email: " . $_GET['email'] . "\n"; $message .= "Query: " . $_GET['query'] . "\n"; $message .= "Joined the blah blah.....\n"; $message .= "send membership information asap"; $message .= 'Comments: '.$_POST['message']; //Subject $subject = 'Feedback from blah blah'; // send the email $send_mail = mail($to, $subject, $message, $messageheader); //Verify that mail has been sent. if (!$send_mail){ echo 'There was an error while sending your email.'; } else { echo 'Your email was sent successfully.'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/63854-mail/#findComment-318282 Share on other sites More sharing options...
sandy1028 Posted August 8, 2007 Author Share Posted August 8, 2007 Hi, Still not able to send the mail Is any packages required for sending mail Quote Link to comment https://forums.phpfreaks.com/topic/63854-mail/#findComment-318295 Share on other sites More sharing options...
NArc0t1c Posted August 8, 2007 Share Posted August 8, 2007 No, It's default with php. Ask you're hosting provider for assistance with this. Quote Link to comment https://forums.phpfreaks.com/topic/63854-mail/#findComment-318297 Share on other sites More sharing options...
sandy1028 Posted August 8, 2007 Author Share Posted August 8, 2007 Is there any tutorial or links... Using mail(); I am not able to send the query to email id... Can you provide me the example code Quote Link to comment https://forums.phpfreaks.com/topic/63854-mail/#findComment-318309 Share on other sites More sharing options...
NArc0t1c Posted August 8, 2007 Share Posted August 8, 2007 try this simple test: mail("you@domain.suffix","Test","This is a test.","From: billgates@microsoft.com"); if that does not work it is you're/host's server that is not configured. Quote Link to comment https://forums.phpfreaks.com/topic/63854-mail/#findComment-318312 Share on other sites More sharing options...
sandy1028 Posted August 8, 2007 Author Share Posted August 8, 2007 Hi, I am not receiving any mails... How to configure the SNMP server.... Is there any way so that it can be used in code Quote Link to comment https://forums.phpfreaks.com/topic/63854-mail/#findComment-318314 Share on other sites More sharing options...
sandy1028 Posted August 8, 2007 Author Share Posted August 8, 2007 Hi, I tried this code I am not receiving any mails but dead.letter is getting saved in home directory <?php $name = "abc"; $invoicetotal = "100"; $mime_boundary = "----Your_Company_Name----".md5(time()); $to = "abc@net.in"; $subject = "This text will display in the email's Subject Field"; $headers = "From: Our Company <28@gmail.com>\n"; $headers .= "Reply-To: Our Company <abc@net.in\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n"; $message = "--$mime_boundary\n"; $message .= "Content-Type: text/plain; charset=UTF-8\n"; $message .= "Content-Transfer-Encoding: 8bit\n\n"; $message .= "$name:\n\n"; $message .= "This email is to confirm that \"Our Company\" has received your order.\n"; $message .= "Please send payment of $invoicetotal to our company address.\n\n"; $message .= "Thank You.\n\n"; $message .= "--$mime_boundary\n"; $message .= "Content-Type: text/html; charset=UTF-8\n"; $message .= "Content-Transfer-Encoding: 8bit\n\n"; $message .= "<html>\n"; $message .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:14px; color:#666666;\">\n"; $message .= "$name:<br>\n"; $message .= "<br>\n"; $message .= "This email is to confirm that \"Our Company\" has received your order.<br>\n"; $message .= "Please send payment of $invoicetotal to our company address.<br>\n\n"; $message .= "<br>\n"; $message .= "Thank You.<br>\n\n"; $message .= "</body>\n"; $message .= "</html>\n"; $message .= "--$mime_boundary--\n\n"; $mail_sent = @mail( $to, $subject, $message, $headers ); echo $mail_sent ? "Mail sent" : "Mail failed"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/63854-mail/#findComment-318315 Share on other sites More sharing options...
NArc0t1c Posted August 8, 2007 Share Posted August 8, 2007 Search google on how to use an SMTP server with php. Quote Link to comment https://forums.phpfreaks.com/topic/63854-mail/#findComment-318318 Share on other sites More sharing options...
sandy1028 Posted August 8, 2007 Author Share Posted August 8, 2007 Is there any way to set the path to SNMP server. The code is not generating mail. I am not able to receive the mail to my mail id <?php // The message $message = "Line 1\nLine 2\nLine 3"; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send //Correct email id given mail(abc@xyz.in', 'My Subject', $message); ?> Quote Link to comment https://forums.phpfreaks.com/topic/63854-mail/#findComment-318344 Share on other sites More sharing options...
sandy1028 Posted August 8, 2007 Author Share Posted August 8, 2007 I am not able to receive the mail to inbox.. What may be the problem. Quote Link to comment https://forums.phpfreaks.com/topic/63854-mail/#findComment-318368 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.