doufeng1249 2012-06-21 15:27
浏览 28
已采纳

很好的电子邮件给用户[关闭]

when it is to my website send email out to users so send some such bland and grime, so that's how I'd like to like / get some color on the page that is being a little style.

I talk with a friend and he says it is possible to style email that you send to users who register on the site. so it is not just such a boring email use get.

Hope you understand otherwise you are very welcome to ask me

I hope you can help me

Can you give me a link or tell what I should do so that I can get a nice email to my users.

if ($stmt = $mysqli->prepare('SELECT NULL FROM `brugere` WHERE `email` = ?')) { 
    $stmt->bind_param('s', $email);
    $email = $_POST['email'];
    $stmt->execute();
    $stmt->store_result();
    $count = $stmt->num_rows;
    $stmt->close();
    if ($count > 0)
    {
        $user_found = 1;
    }
    }
    if(!isset($user_found))
    {
    if($_POST["password"] != $_POST["gentag"])
    {
        $errors = 1;
        echo "<li id=\"check_not\">Skrive ens password p&#229; siden..</li>";
    }
    if (empty($_POST['password']) && empty($_POST['gentag']))
    {
        $errors = 1;
        echo "<li id=\"check_not\">Skrive et password p&#229; siden..</li>";
    }

    if(!isset($errors))
    {
    $pb = null;
    include "class.upload.php";
    $handle = new Upload($_FILES['file']);

    if($handle->uploaded)
    {
    //lidt mere store billeder
    $handle->image_resize = true;
    $handle->image_ratio_y = true;
    $handle->image_x = 220;
    $handle->Process("profil/store");

    //til profil billede lign..
    $handle->image_resize = true;
    $handle->image_ratio_crop = true;
    $handle->image_y = 75;
    $handle->image_x = 75;
    $handle->Process("profil");
    $pb = $handle->file_dst_name;

        echo "<h2>Tak for du opret dig hos xx.dk</h2>";
    ?>
    <img src="http://xx.dk/ (...) echo $pb;?>" alt="profilbillede" height="75" width="75"><br />
    <?php
    echo "<li id=\"check_ok\">Dit billede blev upload</li>";
    }
    else
    {
    ?>
    <img src="http://xx.dk/ (...) alt="profilbillede" height="128" width="128"><br />
    <?php
    echo "<li id=\"check_not\">Du upload intet billede. Vi har dog valgt et profil billede for dig.</li>";
    $pb = 'bruger_intet.png';
    }
    if ($stmt = $mysqli->prepare('INSERT INTO `brugere` (`email`, `katogori`, `djnavn`, `profilbillede`, `profiltekst`, `facebook`, `booking`, `password`, `code`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)')) {

    $stmt->bind_param('sissssssi', $email, $katogori, $djnavn, $profilbillede, $profiltekst, $facebook, $booking, $password, $code);

    $email = $_POST['email'];
    $katogori = $_POST["kategori"];
    $djnavn = $_POST["djnavn"];
    $profilbillede = $pb;
    $profiltekst = $_POST["tekst"];
    $facebook = $_POST["facebook"];
    $booking = $_POST["booking"];
    $password = sha1($_POST['password']);
    $code = rand(111111111,999999999);

    $stmt->execute();
    $stmt->close();

    $to      = $email; // den som skal modtage mailen!
    $subject = "Hej xx.dk - Godkendt brugere konto"; // sende fra
    $msg    = "Tak for du vil opret dig på xx.dk!. 
 
 For at kun activate din konto skal du bare klikke på dette link her: 
 
 http://xx.dk/ (...) 
 
 Du kan ikke besvar den her email!!";
    $header = "from:xx.dk - Godkendt Profil!! <support@xx.dk>";                

    if(mail($to, $subject, $msg, $header))
    {
        echo "<li id=\"check_ok\">Tilsendt e-mail til; $to - Tjek email</li>";
    }
        } 
            else
            {
                echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error;
            }
        }
    }
    else {
        echo "<li id=\"check_not\">Der findes allerede en bruger med denne mail - G&#248;r et fors&#248;g mere <a href=\"http://xxx.dk/ (...) igen...</a></li>";
}
  • 写回答

1条回答 默认 最新

  • douhan9191 2012-06-21 15:31
    关注

    You can just use HTML if you provide the correct headers.

    Example:

    $header .= "MIME-Version: 1.0
    ";
    $header .= "Content-Type: text/html; charset=ISO-8859-1
    ";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊