标签: mvcmailer

MvcMailer SendAsync是否阻止ASP.NET MVC请求?

有谁知道SmtpClientWrapper中的MvcMailer SendAsync方法是否阻止ASP.NET MVC请求?看看MvcMailer维基和代码,我会说是的.

所以,我仍然需要使用像WebBackgrounder作为disussed 这里在我的MVC应用程序安全和真正的异步发送邮件?

我正在寻找一个明确的答案谢谢.

asp.net-mvc mvcmailer

5
推荐指数
1
解决办法
1050
查看次数

在WCF中使用MvcMailer

我们正在创建一个应用程序,它将ASP.NET MVC4用于Web应用程序,而WCF用于访问公共数据存储的Web服务.

网络应用程序使用MvcMailer发送电子邮件,我希望有人可以指出一些资源,显示如何从WCF使用MvcMailer(如果所述资源存在).

我经历过:https://github.com/smsohan/MvcMailer/issues/44

我宁愿不滚动我自己的代码,但如果没有更好的解决方案,我愿意走这条路.

谢谢!

.net c# wcf mvcmailer asp.net-mvc-4

5
推荐指数
1
解决办法
556
查看次数

使用MVCMailer将图像嵌入电子邮件中

你如何使用MVCMailer将图像嵌入到电子邮件中?

我尝试了一些方法

<img src="@Url.Abs("\\..\\images\logo.png")" \> 
Run Code Online (Sandbox Code Playgroud)

没有成功.

任何例子?

谢谢

mvcmailer asp.net-mvc-3

4
推荐指数
1
解决办法
4711
查看次数

如何在web.config中设置不同的stmpclient实例?

我不相信这是一个专门的MvcMailer问题(这是我正在使用的邮件),但我正在努力构建Googleplex搜索,以找出如何根据我的上下文从不同帐户发送电子邮件.

我需要从两个不同的电子邮件帐户发送两封电子邮件.我试过用

mailMessage.From = new MailAddress("some-other-email@gmail.com");
Run Code Online (Sandbox Code Playgroud)

在MvcMailer中,但这甚至没有显示在我转储到临时目录的电子邮件中.它显示为web.config中的内容:"some-email@gmail.com".

这是我对MvcMailer的web.config:

<mailSettings>
      <!-- Method#1: Configure smtp server credentials -->
      <!--<smtp from="some-email@gmail.com">
        <network enableSsl="true" host="smtp.gmail.com" port="587" userName="some-email@gmail.com" password="valid-password" />
      </smtp>-->
      <!-- Method#2: Dump emails to a local directory -->

            <smtp from="some-email@gmail.com" deliveryMethod="SpecifiedPickupDirectory">
                <network host="localhost" />
                <specifiedPickupDirectory pickupDirectoryLocation="c:\temp\" />
            </smtp>

    </mailSettings>
Run Code Online (Sandbox Code Playgroud)

这是邮件代码:

public virtual MailMessage EMailConsultation(EMailConsultationData model)
        {
            var mailMessage = new MailMessage { Subject = "INQUIRY: E-Mail Consultation" };

            mailMessage.From = new MailAddress("some-other-email@gmail.com");//I tested this to see if at the very least it would …
Run Code Online (Sandbox Code Playgroud)

smtpclient mvcmailer asp.net-mvc-3

4
推荐指数
1
解决办法
2226
查看次数

MVCMailer SendAsync()因Amazon SES失败

如果我使用带有MVCMailer的Send(),我的SES工作正常,但SendAsync()显示下面的错误消息,是否有人知道解决此问题?谢谢!

System.Net.Mail.SmtpException: Failure sending mail. ---> System.InvalidOperationException: An asynchronous operation cannot be started at this time. Asynchronous operations may only be started within an asynchronous handler or module or during certain events in the Page lifecycle. If this exception occurred while executing a Page, ensure that the Page is marked <%@ Page Async="true" %>.
   at System.Web.AspNetSynchronizationContext.OperationStarted()
   at System.ComponentModel.AsyncOperation.CreateOperation(Object userSuppliedState, SynchronizationContext syncContext)
   at System.Net.Mail.SmtpClient.SendAsync(MailMessage message, Object userToken)
   --- End of inner exception stack trace ---
   at System.Net.Mail.SmtpClient.SendAsync(MailMessage message, Object userToken)
   at …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc mvcmailer amazon-ses

3
推荐指数
1
解决办法
1725
查看次数

"使用Mvc.Mailer;"时出错

我正在尝试MvcMailer用于在我的MVC3应用程序中发送电子邮件.

我已经成功安装了包MvcMailer.

使用的参考无法安装MvcMailer并按照步骤操作

但是在使用它时会出错. using Mvc.Mailer; The type or namespace name 'MailerBase' could not be found (are you missing a using directive or an assembly reference?)

我在下面的代码中提到错误作为评论.

using Mvc.Mailer;  //The type or namespace name 'Mvc' could not be found (are you missing a using directive or an assembly reference?)

namespace MvcApplicationMvcMailer.Mailers
{ 
    public class UserMailer : MailerBase, IUserMailer   //The type or namespace name 'MailerBase' could not be found (are you missing a using directive …
Run Code Online (Sandbox Code Playgroud)

mvcmailer asp.net-mvc-3

3
推荐指数
1
解决办法
1729
查看次数

如何在使用MvcMailer发送HTML电子邮件的同时使用PreMailer.Net内联CSS

使用MvcMailer,问题是我们的电子邮件是在没有CSS作为内联样式属性的情况下发送的.

PreMailer.Net是一个C#库,可以读取HTML源字符串,并返回带有CSS内联的结果HTML字符串.

我们如何一起使用它们?使用MvcMailer循序渐进指南中的脚手架示例,我们从UserMailer Mailer类中的这个示例方法开始:

public virtual MvcMailMessage Welcome()
{
    return Populate(x => {
        x.ViewName = "Welcome";
        x.To.Add("some-email@example.com");
        x.Subject = "Welcome";
    });
}
Run Code Online (Sandbox Code Playgroud)

css c# email premailer mvcmailer

2
推荐指数
1
解决办法
4080
查看次数

MvcMailer俄罗斯charset在身体问题

我在我的应用程序中安装了MVCMailer.但当我发送邮件与俄罗斯charset身体我得到这样的事情:

ÏðèâåòñòâóåìÂàñíàñàéòåå

好看,不是吗?:)

有关详细信息,可以显示IUserMailer.cs:

namespace photostorage.Mailers
{ 
    public interface IUserMailer
    {
        MailMessage Welcome(string userMail, string login, string password);
        MailMessage PasswordReset();
    }
}
Run Code Online (Sandbox Code Playgroud)

和UserMailer.cs:

       public virtual MailMessage Welcome(string userMail, string login, string password)
        {
            var mailMessage = new MailMessage{Subject = "????? ?????????? ?? FotoStorage.org"};

            mailMessage.To.Add(userMail);
            ViewBag.login = login;
            ViewBag.password = password;
            PopulateBody(mailMessage, viewName: "Welcome");

            return mailMessage;
        }
Run Code Online (Sandbox Code Playgroud)

_Layout.cshtml:

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body>
        @RenderBody()
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

和Welcome.cshtml

<div>
    <div><h1>???????????? ??? ?? ????? ......</h1></div>
    <div>
        <p>
            ??? ?????: @ViewBag.login …
Run Code Online (Sandbox Code Playgroud)

email asp.net-mvc mvcmailer

0
推荐指数
1
解决办法
935
查看次数