Verwenden Sie Velocity zur Generierung des HTML-basierten E-Mail

Ich versuche dieses tutorials http://www.java2s.com/Code/Java/Velocity/UseVelocitytogenerateHTMLbasedemail.htm
aber, wenn ich das hinzufügen von css, die es so Aussehen mag, nicht ausgeführt.

<HTML>
<HEAD>
  <TITLE>Pet Store Sale!</TITLE>
  <style type="text/css">
    body    {
            margin: 0 0 0 0;
            padding: 0 0 0 0;
            text-align: center; 
            background-color: #FFF;
            border-top: 3px solid #CCC;
            }


    #container  {
                position: relative;
                width: 860px;
                height: 1600px;
                margin: 84 auto 0 auto;
                padding: 0 0 0 0;
                background-color: #FFF;
                }


    p       {
            font-family: times, Times New Roman, times-roman, georgia, serif;
            color: #444;
            margin: 0 0 0 0;
            padding: 0 0 0 0;
            text-align: center;
            }


    .woodtwo        {
                    font-size: 22px;
                    line-height: 46px;
                    letter-spacing: -1px;
                    }


    .eyebrow        {   
                    font-size: 19px;
                    line-height: 29px;
                    }


    .caps           {
                    font-size: 14px;
                    line-height: 20px;
                    text-transform: uppercase;
                    }


    .copyone        {
                    font-size: 16px;
                    line-height: 20px;
                    }


    #line           {
                    border-bottom: 1px solid #CCC;
                    width: 748px;
                    margin: 10 0 20 56;
                    }



    #break          {
                    height: 30px;
                    }


    a:link          { color: #B95E27; text-decoration: none; } 
    a:visited       { color: #B95E27; text-decoration: none; }
    a:active        { color: #1A69A1; text-decoration: none; } 
    a:hover         { color: #888; text-decoration: none;}


    .grey           { color: #888; }


    .smallcaps      { font-size: 88%; }


</style>
</HEAD>
<BODY>

<div id="container">
    <p class="caps"><a href="">From Pet Store Sale</a></p>
    <div id="line"></div>
    <p class="eyebrow">
        <span class="grey">*</span>T<span class="smallcaps">HANK YOU FOR JOINING </span>P<span class="smallcaps">ET</span> S<span class="smallcaps">TORE</span> S<span class="smallcaps">ALE</span> A<span class="smallcaps">PPLICATION</span><span class="grey">*</span>
    </p>
    <p class="copyone">
        <i>You received this email because your registration process in Pet Store Sale is successful.<br/>
        To Confirm your registration, please visit this link <a href ="$link">Confirmation Link</a>.<br/>
        Your username : $username<br/>
        Password : $password<br/>
        If you have any questions about Application, please send an email to <a href="mailto:[email protected]">admin@store.com</a></i> 
        <br><br><b>THANK YOU</b>
    </p>
    <div id="break"></div>

    <p class="woodtwo">
        <a href="">GETTING STARTED</a>
    <div id="line"></div>
    <div id="line"></div>
</div>

</BODY>
</HTML>

ich habe auch versucht

<link rel="stylesheet" href="./style/css/emailFormat.css" type="text/css"  media="screen" />

aber es funktioniert nicht zu.
wie Sie den richtigen Weg zum hinzufügen von css auf dieser Seite. Danke

Auch habe ich gerade bemerkt, aber mit einem relativen Pfad zu einer CSS-Datei in einer e-mail wie etwas klingt, das wird nicht funktionieren. Entweder einbetten der CSS oder veröffentlichen Sie es und stellen Sie einen Verweis auf die veröffentlichte Ressource.
wenn du das meinst? '</head> <body > <div id="container"> <p class="caps"><a href="">Test-Anwendung</a></p> <div id="Zeile"></div> <p class="Augenbrauen"> <span class="grey">*</span>T<span class="smallcaps">HANK SIE FÜR den BEITRITT </span>T<span class="smallcaps">INTERESSANTE</span> M<span class="smallcaps">ONITORING</span> Ein<span class="smallcaps">PPLICATION</span><span class="grey">*</span> </p> <p class="copyone"> ..........................'
so, wie das senden von E-Mails im html-format. ich möchte senden Sie ein hübsches E-Mail in java.
Bearbeiten Sie Ihre Frage und fügen Sie den velocity-template. Kommentare sind zu klein und passt nicht zum code. Für die schöne e-mail, haben Sie einen Blick auf meine vorherigen Kommentar. Entweder embedd Ihr CSS in einigen <style> - tags im HTML-code oder den Verweis zu einer öffentlichen CSS-mit einem absoluten URL.
ich habe das Bearbeiten der Frage, hoffentlich in übereinstimmung mit Ihrer Anfrage

InformationsquelleAutor Mahadi Siregar | 2012-04-24

Schreibe einen Kommentar