【问题标题】:Customize subject of EmailService自定义 EmailService 的主题
【发布时间】:2015-09-16 19:12:46
【问题描述】:

我正在尝试自定义电子邮件主题,我的想法是它的用户编写自己的主题......所以,当我在主题空间中收到邮件时,出现用户输入......但我只得到没有主题 我做错了什么?

 public void Contact(String Name, String Email, String Subject, String Description)
    {
        Subject.Replace("{Subject}", Subject);

        var templateText = GetTemplateHtml("Contacto.html");


        templateText = templateText
            .Replace("{Comentario}", Description)
            .Replace("{Email}", Email)
            .Replace("{Name}", Name);

        EmailBody = templateText;
    }

【问题讨论】:

    标签: asp.net-mvc web-services email mandrill


    【解决方案1】:

    这只有在 Subject = "{Subject}" 时才有效

    您是否在代码中设置了断点以确认该值? 您是否在代码中传递了这个值? 此外,您实际上并没有对这个值做任何进一步的事情。

    【讨论】:

    • 我放了一个断点,我在主题字段中插入的值传递了主题参数,但邮件服务不将其读取为主题...
    • 问题是你丢失了很多代码。如果我按照你的代码 sn-p 你有一个具有一些属性的类,也许应该粘贴其余的代码?
    猜你喜欢
    • 1970-01-01
    • 2023-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-01
    • 2014-06-27
    • 2013-01-15
    • 2011-07-11
    相关资源
    最近更新 更多