Jump to content

mail function


searls03

Recommended Posts

here the code.......also how do I put in the background image?:

<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'>";
  ?>
      <?php
    
$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 .= '<br/>$title2:' ; }
if (!empty($title3)) { $message .= '<br/>$title3:'; }
if (!empty($title4)) { $message .= '<br/>$title4:'; }
if (!empty($title5)) { $message .= '<br/>$title5:'; }
if (!empty($title6)) { $message .= '<br/>$title6:'; }
if (!empty($title7)) { $message .= '<br/>$title7:'; }
if (!empty($title8)) { $message .= '<br/>$title8:'; }
}
?>

Link to comment
Share on other sites

ok, I can get it to display the events........only it keeps repeating them..........how do I stop it:

$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 .= "<br/>$title2" ; }
if (!empty($title3)) { $message .= "<br/>$title3"; }
if (!empty($title4)) { $message .= "<br/>$title4"; }
if (!empty($title5)) { $message .= "<br/>$title5"; }
if (!empty($title6)) { $message .= "<br/>$title6"; }
if (!empty($title7)) { $message .= "<br/>$title7"; }
if (!empty($title8)) { $message .= "<br/>$title8"; }
}

Link to comment
Share on other sites

so any help on the background issue?:

with this code it works on my ipod but not gmail?  is this a browser specific or something

$mailimg = '
<img src="http://final.net46.net/button/boyscout.jpg"</a>
';
	$message = "<html>
	<style type='text/css'>
#apDiv1 {
position:absolute;
left:338px;
top:278px;
width:311px;
height:129px;
z-index:1;
}
#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"; }



  
?>
<?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>
<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>

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

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.