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 7992043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:27:48+00:00 2026-06-04T13:27:48+00:00

CI am using MVC.ActionMailer to send emails from my website. I am having issues

  • 0

CI am using MVC.ActionMailer to send emails from my website. I am having issues with embedding an inline image into the email.

Here is my Controller Action

public EmailResult WelcomeEmail()
    {
        WelcomeMailVM welcomeDetails = new WelcomeMailVM()
        var path = HttpContext.Current.Server.MapPath("~/Content/images/myImage.png");
        Attachments.Add("myImage.png", System.IO.File.ReadAllBytes(path));
        //Attachments.Inline["holidaymate.png"] = System.IO.File.ReadAllBytes(path);
        To.Add("someEmail@test.com");
        From = "noreply@myDomain.com";
        Subject = "Welcome to My Site;
        return Email("WelcomeEmail", welcomeDetails);
    }

and the view for the email

@model HolidayMate.API.ViewModels.Mail.WelcomeMailVM
@using ActionMailer.Net.Mvc

@{
     Layout = "~/Views/Shared/_MailLayout.cshtml";
 }
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

 <table cellpadding="0" cellspacing="0" border="0" id="backgroundTable">
 <tr>
    <td style="width:300px">
        @Html.InlineImage("myImage.png")
    </td>
    <td style="width:300px">
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td>Date</td>
                <td>@DateTime.Now.ToString("dd MMMM yyyy")
                </td>
            </tr>
        </table>
    </td>
</tr>
</table>

The email sends perfectly. But the image is not displayed in the email. I get this issue with gmail and with thunderbird. Unfortunately I do not have outlook to test on. When googling i found the following

#38 Inline images are not displayed in Thunderbird

But i am not sure where to send the content type for the email. Please any help would be greatly appreciated.

  • 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-06-04T13:27:49+00:00Added an answer on June 4, 2026 at 1:27 pm

    I used the MVC Mailer instead of the ActionMailer. Now the images works fine.

    But now i can’t sent the email unless i use the following SMTP Settings, my normal settings does not work

    <mailSettings >
      <smtp deliveryMethod="Network" from="noreply@holidaymate.co.za">
        <network enableSsl="true" host="mail.mySMTP.com" port="25"  defaultCredentials="true" />
      </smtp>
    </mailSettings>
    

    Does not work, but when using the following it works

    <mailSettings >
      <smtp deliveryMethod="Network" from="noreply@myDomain.co.za">
          network enableSsl="true" host="smtp.gmail.com" port="587" userName="someemail@gmail.com" password="mypassword"/>
      </smtp>
    </mailSettings>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use ActionMailer 0.7.0 to send a email from my MVC 3
I am using MVC Extension with Autofac and I am having issues with my
I'm using MVC. I copied the login form from the login page and inserted
I'm using MVC 2 with some Models from a LinqToSql project that I built.
I am using MVC. How do I delete all records from the database using
(Using MVC 2) From inside my controller action, I need to display the url:
Setup Using MVC 3 + Code First Here are my classes public class Member
I'm using MVC 3, and I'm trying to exclude some fields from validation in
I'm using MVC 4 (beta), and having some problems trying to test an auth
I am using MVC and bootstrap to create a website and have mostly been

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.