PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Tue Aug 31, 2004 10:55 am
using mime mail. this ends up in junk..
plain text with a link ofcourse, this mail is send after a form has been submitted. my headers as below
Code: Select all
$hdrs = array(
'Content-Type' => 'multipart/alternative\r\n',
'Content-Type' => 'text/html; charset=iso-8859-1\r\n',
'From' => 'Support@--------------.com\r\n',
'Subject' => 'Registro'
);
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Tue Aug 31, 2004 11:56 am
Try using double quotes instead of single. \r and \n don't do what you expect inside single quotes, they need double quotes to turn them into carriage return & line-feed
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Tue Aug 31, 2004 12:02 pm
Still no go. .it makes me go absolutely mad.. especially when u kno0w that outlook itself does send it out and wont end up in junk mail.
Code: Select all
$hdrs = array(
"Content-transfer-encoding"=> "8bit\r\n",
"Content-Type" => "text/html; charset=iso-8859-1\r\n",
"Return-Path" => "support@--------------.com\r\n",
"MIME-Version"=> "1.0\r\n",
"From" => "Support@-------------.com\r\n",
"Subject" => "To Hoja de Vida Online\r\n"
);
#trying it all.. But.. GrrRRr
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Aug 31, 2004 12:05 pm
just to make sure:
you're imploding that array, in some fashion, to a single string for the mail function, correct?
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Tue Aug 31, 2004 12:11 pm
Code: Select all
include('Mail.php');
include('Mail/mime.php');
$html = '<html><body>large chunk of text, <a href="domein.com/id?=91612131213">Gracias</a></body></html>';
$crlf = "\r\n";
$hdrs = array(
"Content-Type" => "text/html; charset=iso-8859-1\r\n",
"Content-Transfer-Encoding"=> "binary\r\n",
"Return-Path" => "support@---------.com\r\n",
"MIME-Version"=> "1.0\r\n",
"From" => "Support@----------.com\r\n",
"Subject" => "To Hoja de Vida Online\r\n"
);
$mime = new Mail_mime($crlf);
$mime->setHTMLBody($html);
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail');
$mail->send('-------@hotmail.com', $hdrs, $body);
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Tue Aug 31, 2004 12:12 pm
I don't know what the Mail_mime class is/does but this works ok
Code: Select all
<?php
$hdrs = array(
'Content-transfer-encoding'=> "8bit\r\n",
'Content-Type' => "text/html; charset=iso-8859-1\r\n",
'Return-Path' => "support@wherever.com\r\n",
'MIME-Version'=> "1.0\r\n",
'From' => "Support@wherever.com\r\n",
'Subject' => "To Hoja de Vida Online"
);
$to = 'youremail@goeshere.com';
$message = 'A link <a href="http://www.google.com">google</a> here.';
$headers = '';
foreach($hdrs as $key=>$val){
$headers .= $key.': '.$val;
}
mail($to, $hdrs['Subject'], $message, $headers);
echo 'Sent';
?>
It's not the cleanest way to do it but it works with your array format.
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Tue Aug 31, 2004 12:13 pm
i will try this.. back in a bit.. however what is the clean way.
I dont know but.. my hotmail just junks it..
my text and ure google example text.
i do not have my filter set to the max.
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Tue Aug 31, 2004 12:24 pm
it even junks this
Code: Select all
<html><body><p><body><div><font face="Arial" size="2"><div>Hola..</font></div></body></html>