Jump to content

adding name to sender


MSUK1

Recommended Posts

in my php mail i use this code:

$success = mail($EmailFrom, $Subject, $Body2, "From: <$EmailTo>");

 

and here are the variables for emial from and email to,

$EmailFrom = Trim(stripslashes($_POST['email'])); 
$EmailTo = "info@mydomain.co";

 

when the email is received the sender just appears as info@mydomain.co how can i have it say MSUKGroup Auto Responder or something? instead of just repeat the address?

Link to comment
Share on other sites

ok so started to use HTML emails, how can i now add php variables into that email ive tried this not working? done some research on google firsts too, tried another metod of using " . $var . " but no luck?

$message = '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MSUKGroup</title>
</head>

<body>

<table style="width: 100%" cellspacing="0" cellpadding="0">
			<!-- MSTableType="layout" -->
			<tr>
							<td valign="top">
							<table style="width: 500px" cellspacing="0" cellpadding="0">
											<!-- MSTableType="layout" -->
											<tr>
															<td valign="top">
															<img src="http://www.msukgroup.co/img/logos/orange.png" width="323" height="42" /></td>
											</tr>
											<tr>
															<td valign="top" style="margin-top:2px" class="maincontent">
															<p>Dear {$name} ,</p>
															<p> </p>
															<p>Thankyou for 
															contacting us 
															via our online 
															form, we have 
															collected the 
															following from 
															your query:</p>
															<ul>
																			<li>name:<br />{$name}
																			</li>
																			<li>email:<br />$email}																				</li>
																			<li>website:<br />$web}																			</li>
																			<li>tel:<br />{$tel}																				</li>
																			<li>subject:<br />{$sub}																			</li>
																			<li>message:<br />{$message}																		</li>
															</ul>
															<p>If their is 
															anything else we 
															can assist you 
															with please call 
															us, our number 
															can be found on 
															our website at
															<a href="http://www.msukgroup.co">
															<span class="footer2">
															http://www.msukgroup.co</span></a>
															</p>
															<p> </p>
															<p>  </p>
															</td>
											</tr>
											<tr>
															<td class="footer1" valign="top">
															 </td>
											</tr>
							</table>
							</td>
			</tr>
</table>

							</body>

</html>
';

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.