2017-06-23 3 views
1

cssでhtmlページを使用してc#asp.netから電子メールを送信する方法はありますか。cssで電子メールを送信するときにCSSを取得できません

現在、私は、電子メールを送信していますが、私はGmailで開いたとき、それはCSSはHTMLページの中に含ま捕捉しない

<html> 
    <head> 
    <meta charset="utf-8" /> 
    <title></title> 
    <style> 
    body{ 
     background-color:navy; 
     color:white; 
     font-family:Menulis; 
     margin-left:40px; 
    } 

    div { 
     margin:0 auto; 
    } 

    img{ 
     border-radius:5px; 
     width:200px; 
     height:300px; 
     margin-right:200px; 
     display:block; 
     float:right; 
    } 

</style> 
</head> 

<body> 
<div> 
    <h1>User {user_email} Error Report</h1> 
    <p>The following error occured when user is trying to reset password  

    from pswrd_recover.aspx page:</p><br/> 
    <img src="https://pcappliancerepair.files.wordpress.com/2016/11 
/38644550_m.jpg?w=585"/> 
    <p>{error_message}</p> 

    </div> 
</body> 
</html> 

答えて

1

Gmailでは、メールのHTMLの全体頭部部分を削除します。したがって、のスタイル要素も削除されます。

<body style="background-color:navy; color:white;font-family:Menulis;margin-left:40px;"> 
<div style="margin:0 auto;">...</div> 
<img style="border-radius:5px;width:200px;height:300px;margin-right:200px;display:block;float:right;" src="https://..." /> 
</body> 
+0

'