Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

Mail Function Error Results On Gmail

the mail() function

Moderators: macek, egami, gesf

Mail Function Error Results On Gmail

Postby ImanLlusion » Tue Feb 19, 2013 11:18 pm

I have a source code function mail like this :


<?php
$emailTo = $_POST['email_tujuan'];
$subject = $_POST['title'];
$body = "
Dear ".$_POST['nama'].",


Judul :
".$_POST['judul']."

".$_POST['singkat']."

Link :
".$_POST['url']."

Pesan :
".$_POST['pesan']."
";
$headers = 'From: '.$_POST['nama'].' <'.$_POST['email_anda'].'>' . "\r\n" . 'Reply-To: ' . $_POST['email_anda'];
mail($emailTo, $subject, $body, $headers);
?>


and then sent the results like this:

Dear Iman Llusion,


Title:
[object HTMLInputElement]



link:
[object HTMLInputElement]

message:
loamy


But why could appear [object HTMLInputElement], [object HTMLInputElement]?
What was wrong? Anybody help me a beginner's... ^ _ ^
ImanLlusion
New php-forum User
New php-forum User
 
Posts: 4
Joined: Tue Dec 04, 2012 8:38 pm

Re: Mail Function Error Results On Gmail

Postby seandisanti » Mon Feb 25, 2013 2:00 pm

where is it returning that? it looks like you're converting a value to an object at some point, and then trying to use it as a string. look for a 'new' string that may have gotten dropped into the wrong place. also, you can check your values by adding
Code: Select all

<?php 
echo '<pre>';
print_r($_POST);
 

at the top of your script. that way you'll see everything contained in each element of the post, and that will help you spot objects or values that don't belong
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron