Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Web Programming
Reload this Page 000webhost.com mail sender name change
Reply
 
Thread Tools Display Modes
(#1 (permalink))
Old
SABOND21's Avatar
Junior Member
SABOND21 is on a distinguished road
 
Posts: 2
Join Date: May 2012
Send a message via ICQ to SABOND21 Send a message via AIM to SABOND21 Send a message via MSN to SABOND21 Send a message via Yahoo to SABOND21 Send a message via Skype™ to SABOND21
Question 000webhost.com mail sender name change - 05-15-2012, 05:00 AM

Hello! I am using PHP contact form on my website and want to know - Is it possible to change senders name, I am receiving emails with Sender name like axxxxxxx@srv30.000webhost.com - can I change it?
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
echo442's Avatar
Senior Member
echo442 is on a distinguished road
 
Posts: 173
Join Date: Feb 2012
Location: UK
Default 05-15-2012, 02:03 PM

yes you can set it that the senders email is a email address you run

Quote:
<input type="hidden" name="email_address" value="info@echo442.uphero.com" maxlength="1" />
and that will be the address that is has come from
Reply With Quote
(#3 (permalink))
Old
SABOND21's Avatar
Junior Member
SABOND21 is on a distinguished road
 
Posts: 2
Join Date: May 2012
Send a message via ICQ to SABOND21 Send a message via AIM to SABOND21 Send a message via MSN to SABOND21 Send a message via Yahoo to SABOND21 Send a message via Skype™ to SABOND21
Default 05-15-2012, 04:53 PM

echo442
1st: your solution hides away Submit button, because you put type="hidden"
2nd: when i put value="info@echo442.uphero.com" - it shows Submit button not with the name Submit, but with this address name
3d: when I use name="email_address" my PHP form simply doesn't work...
Reply With Quote
(#4 (permalink))
Old
echo442's Avatar
Senior Member
echo442 is on a distinguished road
 
Posts: 173
Join Date: Feb 2012
Location: UK
Post you can use this one - 05-15-2012, 05:13 PM

this one works and the email box is hidden for work example go here http://brick-decals.tk/email/test.php
Quote:
<?php
if ($_POST["email"]<>'') {
$ToEmail = 'info@echo442.uphero.com';
$EmailSubject = 'Site contact form';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY = "Name: ".$_POST["name"]."";
$MESSAGE_BODY .= "Email: ".$_POST["email"]."";
$MESSAGE_BODY .= "Comment: ".nl2br($_POST["comment"])."";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
?>
Your message was sent
<?php
} else {
?>
<form action="test.php" method="post">
<table width="400" border="0" cellspacing="2" cellpadding="0">
<tr>
<td width="29%" class="bodytext">Your name:</td>
<td width="71%"><input name="name" type="text" id="name" size="32"></td>
</tr>
<tr>
<td class="bodytext"></td>
<td><input type="hidden" name="email" type="text" id="email" value="info@echo442.uphero.com (your email " size="32"></td>
</tr>
<tr>
<td class="bodytext">Comment:</td>
<td><textarea name="comment" cols="45" rows="6" id="comment" class="bodytext"></textarea></td>
</tr>
<tr>
<td class="bodytext"> </td>
<td align="left" valign="top"><input type="submit" name="Submit" value="Send"></td>
</tr>
</table>
</form>
<?php
};
?>
Reply With Quote
(#5 (permalink))
Old
tpolis's Avatar
Senior Member
tpolis is on a distinguished road
 
Posts: 254
Join Date: Aug 2011
Location: Azeroth
Send a message via ICQ to tpolis Send a message via AIM to tpolis Send a message via MSN to tpolis Send a message via Skype™ to tpolis
Default 05-22-2012, 04:28 PM

Quote:
Originally Posted by echo442 View Post
this one works and the email box is hidden for work example go here http://brick-decals.tk/email/test.php
Looks good.
Reply With Quote
(#6 (permalink))
Old
Junior Member
albertogomez is on a distinguished road
 
Posts: 7
Join Date: Jun 2012
Default Same problem and not solved - 06-07-2012, 10:45 AM

Hello guys,

I do not really know how to use the php code provided. where should I put it? in a separate file? under which folder? How can I call the php code from an html file? Can I actually put the php file within the html file?

If someone could explain this as for dummies, i would really appreciate.

Cheers!

Thanks a lot
Reply With Quote
(#7 (permalink))
Old
echo442's Avatar
Senior Member
echo442 is on a distinguished road
 
Posts: 173
Join Date: Feb 2012
Location: UK
Smile in php file and iframe - 06-07-2012, 11:09 AM

put the cdoe that quote in to a php file called email.php and then you can use an iframe to put the code in to a .html file
Quote:
<iframe src="email.php"></iframe>
php code
Quote:
<?php
if ($_POST["email"]<>'') {
$ToEmail = 'info@echo442.uphero.com';
$EmailSubject = 'Site contact form';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY = "Name: ".$_POST["name"]."";
$MESSAGE_BODY .= "Email: ".$_POST["email"]."";
$MESSAGE_BODY .= "Comment: ".nl2br($_POST["comment"])."";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
?>
Your message was sent
<?php
} else {
?>
<form action="test.php" method="post">
<table width="400" border="0" cellspacing="2" cellpadding="0">
<tr>
<td width="29%" class="bodytext">Your name:</td>
<td width="71%"><input name="name" type="text" id="name" size="32"></td>
</tr>
<tr>
<td class="bodytext"></td>
<td><input type="hidden" name="email" type="text" id="email" value="info@echo442.uphero.com (your email " size="32"></td>
</tr>
<tr>
<td class="bodytext">Comment:</td>
<td><textarea name="comment" cols="45" rows="6" id="comment" class="bodytext"></textarea></td>
</tr>
<tr>
<td class="bodytext"> </td>
<td align="left" valign="top"><input type="submit" name="Submit" value="Send"></td>
</tr>
</table>
</form>
<?php
};
?>
Reply With Quote
(#8 (permalink))
Old
Junior Member
albertogomez is on a distinguished road
 
Posts: 7
Join Date: Jun 2012
Default email not sendong - 06-07-2012, 11:37 AM

Thanks a lot for the answer. I have done as you said and replaced the two email addresses for the gmail address I want the email to be delivered to, but I get nothing. I guess the problem is the php mail function. Does it need to be configured with email servers or anything?

Still, the only thing I want to do is change the default sender in the contact module so that sent emails are not sent to spam.

Maybe it is easier to go to the code of the default contact form and modify it. Do you know where thios code is? i am uising the 000webhost web builder...

Thanks a lot!
Reply With Quote
(#9 (permalink))
Old
ShocK's Avatar
Senior Member
ShocK is on a distinguished road
 
Posts: 4,073
Join Date: Jul 2011
Location: UK
Default 06-07-2012, 11:46 AM

Do you mean the template of the contact form in website builder? In website builder , click on contact on the left, and then click the little blue "template" word. Then click the tiny "html" icon for the source code to the contact form.
Reply With Quote
(#10 (permalink))
Old
Junior Member
albertogomez is on a distinguished road
 
Posts: 7
Join Date: Jun 2012
Default Still not there - 06-07-2012, 12:21 PM

Thanks a lot for the advice!

When I do as you say, the code only shows:

{%contact%}

Which I guess is kind of a macro or something, but I cannot see the code of that macro :-(
Reply With Quote
Reply

Tags
mail sender name change

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com