Jump to content

mail function background


searls03

Recommended Posts

OK, so I have a mail function code:

$to = "$email";
	// Change this to your site admin email
	$from = "[email protected]";
	$subject = "Thank You for Registering for $event. ";




	//Begin HTML Email Message where you need to change the activation URL inside

	$message = "<html>
	<head>
	<style type='text/css'>
#apDiv1 {
position:absolute;
left:338px;
top:278px;
width:311px;
height:129px;
z-index:1;
}



#pic {
position:relative;
left:0px;
top:0px;

}
#apDiv2 {
position:absolute;
left:50px;
top:207px;
width:181px;
height:149px;
z-index:2;
}
#apDiv2 {
text-align: center;
}

</style>
</head>

<body><div id='apDiv1'>

  <table width='408' border='1' cellspacing='2' cellpadding='2'>
    <tr>
      <th width='90' scope='col'>Event(s):</th>
      <th width='298' scope='col'>";      
    
$sql = ("SELECT * FROM Events WHERE eventid='$eventid'");
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)){
$event = $row['event'];
$startdate = $row['startdate'];
$enddate = $row['enddate'];
$description = $row['description'];
$location = $row['location'];
$subevent1 = $row['subevent1'];
$subevent2 = $row['subevent2'];
$subevent3 = $row['subevent3'];
$subevent4 = $row['subevent4'];
$subevent5 = $row['subevent5'];
$subevent6 = $row['subevent6'];
$subevent7 = $row['subevent7'];
$subevent8 = $row['subevent8'];
}

if (!empty($title1)) { $message .= "<br/>$title1"; }
if (!empty($title2)) { $message .= "<hr><br/>$title2" ; }
if (!empty($title3)) { $message .= "<hr><br/>$title3"; }
if (!empty($title4)) { $message .= "<hr><br/>$title4"; }
if (!empty($title5)) { $message .= "<hr><br/>$title5"; }
if (!empty($title6)) { $message .= "<hr> <br/>$title6"; }
if (!empty($title7)) { $message .= "<hr><br/>$title7"; }
if (!empty($title8)) { $message .= "<hr><br/>$title8"; }
echo "</div>";  
?>
<?php
$message .="
</th>
    </tr>
    <tr>
      <th>Price:</th>
      <th>
      $ $total

</th>
    </tr>";
?>
<?php
$message .="
    <tr>
      <th>Registrant:</th>
      <th>  $name </th>
    </tr>
  </table>";
  ?>
  <?php $message .="
  <div id='pic'>
<img src=\"http://final.net46.net/button/boyscout.jpg\">

<div id='apDiv2'>$name
  <p> </p>
  <p> </p>
  <p><a href='final.net46.net' target='_new'><strong>Troop 78 Home</strong></a></p>
  <p> </p>
  <p> </p>
  <p><strong><a href='http://www.cornhuskercouncil.org'>Cornhusker Council</a></strong></p>
  <p> </p>
  <p> </p>
  <p> </p>
  <p> </p>
  <p> </p>
  <p> </p>
</div>
</div>


	</body>
	</html>";
	?>
        <?php
	// end of message
	$headers = "From: $from\r\n";
	$headers .= "Content-Type: text/html\r\n";
	$to = "$to";
	// Finally send the activation email to the member
	mail($to, $subject, $message, $headers);

I would like this image <img src=\"http://final.net46.net/button/boyscout.jpg\">

to be the background.............and everything else is layered on top of that.........how can I do this?

 

 

Link to comment
https://forums.phpfreaks.com/topic/233910-mail-function-background/
Share on other sites

still not.............the table is being displayed above the image:

$to = "$email";
	// Change this to your site admin email
	$from = "[email protected]";
	$subject = "Thank You for Registering for $event. ";




	//Begin HTML Email Message where you need to change the activation URL inside

	$message = "<html>
	<head>
	<style type='text/css'>
#apDiv1 {
position:absolute;
left:338px;
top:278px;
width:311px;
height:129px;
z-index:1;
}



#pic {
position:relative;
left:0px;
top:0px;

}
#apDiv2 {
position:absolute;
left:50px;
top:207px;
width:181px;
height:149px;
z-index:2;
}
#apDiv2 {
text-align: center;
}
body {
background-image: url(final.net46.net/button/boyscout.jpg);
background-repeat: no-repeat;
}
</style>
</head>

<body><div id='apDiv1'>

  <table width='408' border='1' cellspacing='2' cellpadding='2'>
    <tr>
      <th width='90' scope='col'>Event(s):</th>
      <th width='298' scope='col'>";      
    
$sql = ("SELECT * FROM Events WHERE eventid='$eventid'");
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)){
$event = $row['event'];
$startdate = $row['startdate'];
$enddate = $row['enddate'];
$description = $row['description'];
$location = $row['location'];
$subevent1 = $row['subevent1'];
$subevent2 = $row['subevent2'];
$subevent3 = $row['subevent3'];
$subevent4 = $row['subevent4'];
$subevent5 = $row['subevent5'];
$subevent6 = $row['subevent6'];
$subevent7 = $row['subevent7'];
$subevent8 = $row['subevent8'];
}

if (!empty($title1)) { $message .= "<br/>$title1"; }
if (!empty($title2)) { $message .= "<hr><br/>$title2" ; }
if (!empty($title3)) { $message .= "<hr><br/>$title3"; }
if (!empty($title4)) { $message .= "<hr><br/>$title4"; }
if (!empty($title5)) { $message .= "<hr><br/>$title5"; }
if (!empty($title6)) { $message .= "<hr> <br/>$title6"; }
if (!empty($title7)) { $message .= "<hr><br/>$title7"; }
if (!empty($title8)) { $message .= "<hr><br/>$title8"; }
echo "</div>";  
?>
<?php
$message .="
</th>
    </tr>
    <tr>
      <th>Price:</th>
      <th>
      $ $total

</th>
    </tr>";
?>
<?php
$message .="
    <tr>
      <th>Registrant:</th>
      <th>  $name </th>
    </tr>
  </table>";
  ?>
  <?php $message .="
  <div id='pic'>
<img src=\"http://final.net46.net/button/boyscout.jpg\">

<div id='apDiv2'>$name
  <p> </p>
  <p> </p>
  <p><a href='final.net46.net' target='_new'><strong>Troop 78 Home</strong></a></p>
  <p> </p>
  <p> </p>
  <p><strong><a href='http://www.cornhuskercouncil.org'>Cornhusker Council</a></strong></p>
  <p> </p>
  <p> </p>
  <p> </p>
  <p> </p>
  <p> </p>
  <p> </p>
</div>
</div>


	</body>
	</html>";
	?>
        <?php
	// end of message
	$headers = "From: $from\r\n";
	$headers .= "Content-Type: text/html\r\n";
	$to = "$to";
	// Finally send the activation email to the member
	mail($to, $subject, $message, $headers);

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.