I have created a simple form that will get a “subject” and “message” that I type in and send it. I can get it to send attachments, but can not get embedded images to work, or hyperlinks. When I check the received email and look at the link properties, it says the name of my email provider and then the link rather than the absolute address of the link. Images just come as an X and links come up as nothing. Any ideas? Is there a way to tell it not to read whatever it is that the clients email reader is putting infront of it? Thanks for any help.
[code=php]
<?php #10
include(“Vars.php”);
$email = $_REQUEST[’email’];
$connection = mysql_connect($host, $user, $passwd)
or die (“getSQL mysql_connect ($host, $user, $passwd)” . mysql_error ());
$db = mysql_select_db($database)
or die (“Couldn’t select database.”);
if($submit==”Send”)
{
require_once ‘MIME.php’;
$report = mysql_query(“SELECT * FROM email_address”); #20
while($row = mysql_fetch_array($report))
{
$to = $row[’email’];
$id = MIME::unique(); // get ID value (random) for the embed image
$subject = $_REQUEST[‘subject’];
$themessage = $_REQUEST[‘message’];
$message = $themessage;
$text = MIME::message(‘Text version of message.’, ‘text/plain’); // set text/plain version of message
$html = MIME::message($message, ‘text/html’); // set text/html version of message
//$at[] = MIME::message(‘source file’, ‘text/plain’, ‘file.txt’, ‘ISO-8859-1’, ‘base64’, ‘attachment’); // add attachment with name ‘file.txt’
$file = ‘xpertmailer.gif’; // add inline attachment ‘$file’ with name ‘XPM.gif’ and ID ‘$id’
$at[] = MIME::message(file_get_contents($file), FUNC::mime_type($file), ‘XPM.gif’, null, ‘base64’, ‘inline’, $id);
$mess = MIME::compose($text, $html, $at); // compose mail message in MIME format
$send = mail($to, $subject, $mess[‘content’], ‘From: [email protected]’.”n”.$mess[‘header’]);
}
};
?>