Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4582742
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:07:05+00:00 2026-05-21T21:07:05+00:00

Im looking to use MVCMailer to send emails using asp.net mvc 3 with razor.

  • 0

Im looking to use MVCMailer to send emails using asp.net mvc 3 with razor. Also mentioned by ScottHa

It looks fairly straight forward, however i’m confused as to how I would send batch emails eg like a newsletter to a list of users.

do i create a loop around this?

public virtual MailMessage Welcome()
{
    var mailMessage = new MailMessage{Subject = "Welcome to MvcMailer"};

    mailMessage.To.Add("sohan39@example.com");
    ViewBag.Name = "Sohan";
    PopulateBody(mailMessage, viewName: "Welcome");

    return mailMessage;
}

can someone explain?
thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T21:07:06+00:00Added an answer on May 21, 2026 at 9:07 pm

    Unfortunately because each email message is personalized, I can’t see any other way other than looping. So just change your method to something like:

    public virtual MailMessage Welcome(string email, string name)
    {
        var mailMessage = new MailMessage{Subject = "Welcome to MvcMailer"};
    
        mailMessage.To.Add(email);
        ViewBag.Name = name;
        PopulateBody(mailMessage, viewName: "Welcome");
    
        return mailMessage;
    }
    

    And then call that method inside your loop and send it at the same time.

    Important Note

    You should setup your web.config to use a pickup directory rather than a SMTP server. Then get IIS to send the email from the pickup directory.

    Reasoning – Because you could potentially be calling SmtpClient.Send(MailMessage mailmessage) any number of times – this could become rather expensive if you have to connect to a SMTP server each time to send the email.

    A nice side effect of this is you also get some redundancy if the SMTP server is down or unreachable for any reason.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking to use quartz to schedule emails, but I'm not sure which
We are looking to use the MVC Framework in our SP Application. This is
I'm looking to use the HTML Bridge to send data currently in an ObservableCollection
I'm looking to use the Zimt library and the ZTWebSocket class has a 'send'
I'm looking to use SELECT LAST_INSERT_ID() Am using a form to have a user
I am looking to use a PHP library for uploading pictures to a web
I'm looking to use procedurally-generated sound and music in a Flash program I'm writing.
I am looking to use Java to get the MD5 checksum of a file.
If I'm looking to use Core Animation to fade a view in and out
I'm looking to use: #define and #if to allow me to simulate potentially absent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.