Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MVC Mailer with Gmail, From address and name is "me" instead of what is populated from form submission #149

Open
theericharms opened this issue Jun 16, 2015 · 0 comments

Comments

@theericharms
Copy link

Hi,
Using mvcmailer to send emails for a form submission, and we set the From to be the name and email that was gathered in the form. We use an email account (ie: ourmail@domain.com) which is used as the email account to send us the form data. The email is sent to that same account.

All was working on our Arvixe mail server, but my client switched to Gmail for Business, and now when it comes into our Gmail inbox, the message is from "me", and has our name and our email address that we use to send the form data. Ive been trying to sort this out with Google support but they dont seem to know how to fix it.

Has anyone witnessed this before? heres an example of how we set the From parameter.

public virtual MvcMailMessage ContactUs(Contact contact)
{
ViewData["contactForm"] = contact;

        Debug.WriteLine(contact);

        return Populate(x =>
        {
            x.Subject = "Contact Form";
            x.ViewName = "ContactUs";
            x.To.Add(new MailAddress(ConfigurationManager.AppSettings["Email"]));
            x.Bcc.Add(new MailAddress(ConfigurationManager.AppSettings["BCCEmail"]));
            x.From = (new MailAddress(contact.Email, displayName: contact.Email));
            x.IsBodyHtml = true;
        });
    }

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant