Jump to content

email style isnt working

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
hey guys im trying to send HTML emails, its working fine the html part is working but i cant get style to work
heres my code:

<?php


$headers="from: test@test.com \r\nMIME-Version:1.0\r\nContent-Type:text/html; charset=\"iso-8859\" \r\n";

$headers.="Content-Transfer-Encoding: 7bit\r\n";

$content=<<<asd

<style type="text/css">

h3{

color: maroon;

font-style: italic;

}

.main{

border: 2px black dotted;

color: white;

background-color: black;

}

</style>

<h3>title here</h3>

<div class='main'>

test msg test msg test msg test msg test 

</div>

asd;

print $content;

$result=mail("amrosama2020@gmail.com","test",$content,$headers);

it sends the email without styles
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
I believe you need a properly structured HTML document for this to work. You have no <html>, <head> or <body> tags.

<?php 

$headers="from: test@test.com \r\nMIME-Version:1.0\r\nContent-Type:text/html; charset=\"iso-8859\" \r\n"; 
$headers.="Content-Transfer-Encoding: 7bit\r\n"; 
$content=<<<asd 
<html>
<head>
<style type="text/css"> 
h3{ 
color: maroon; 
font-style: italic; 
} 
.main{ 
border: 2px black dotted; 
color: white; 
background-color: black; 
} 
</style> 
</head>
<body>
<h3>title here</h3> 
<div class='main'> 
test msg test msg test msg test msg test  
</div> 
</body>
</html>
asd; 
print $content; 
$result=mail("amrosama2020@gmail.com","test",$content,$headers);


#3
alilg

alilg

    Learning Programmer

  • Members
  • PipPipPip
  • 56 posts
i apply my css style to each element separately when i want to send a html mail!

i prefer
<div style="font-size:9pt;color:blue;">MESSAGE</div>

instead of this in my HTML-MAILS only
<style type="text/css">
.clean{
font-size:9pt;
color:blue;
}
</style>
<div class="clean">MESSAGE</div>