+1 vote

I'm using the Fluent interface to render and send an html email, but I can't figure out how to set the reply-to email address. My code is below.

Limilabs.Mail.Fluent.Mail.Html(Template
              .FromFile("EmailTemplate.txt")
              .DataFrom(templateData)
              .Render())
            .From(new MailBox("myemail@email.com", "Me"))
            .To(new MailBox(emailTo))
            .Subject("My Subject Line")

            .UsingNewSmtp()                
            .WithCredentials("myemail@email.com", "password")")
            .Server("smtp.gmail.com")
            .WithSSL()
            .Send();
by

1 Answer

+1 vote

You need to add IFluentMail.ReplyTo method invocation and specify email address as a parameter:

.ReplyTo(new MailBox(emailReplyTo))

Here's the full code:

Limilabs.Mail.Fluent.Mail.Html(Template
          .FromFile("EmailTemplate.txt")
          .DataFrom(templateData)
          .Render())
        .From(new MailBox("myemail@email.com", "Me"))
        .To(new MailBox(emailTo))
        .ReplyTo(new MailBox(emailReplyTo))   // <---
        .Subject("My Subject Line")

        .UsingNewSmtp()
        .WithCredentials("myemail@email.com", "password")")
        .Server("smtp.gmail.com")
        .WithSSL()
        .Send();
by (301k points)
...