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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:23:19+00:00 2026-05-16T17:23:19+00:00

I have an image in my VB.NET Picture box. I would like to attach

  • 0

I have an image in my VB.NET Picture box. I would like to attach it to the email message I’m sending through Outlook without having to save it to the drive anywhere. Is it possible to do such a thing?

Here’s what I have so far (taken from here):

Public Class email
    Dim app As Microsoft.Office.Interop.Outlook.Application
    Dim appNameSpace As Microsoft.Office.Interop.Outlook._NameSpace
    Dim memo As Microsoft.Office.Interop.Outlook.MailItem
    Dim outbox As Microsoft.Office.Interop.Outlook.MAPIFolder

    Public Sub New(ByVal attachment)
        Try
            app = New Microsoft.Office.Interop.Outlook.Application
            appNameSpace = app.GetNamespace("MAPI")
            appNameSpace.Logon(Nothing, Nothing, False, False)

            memo = app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
            memo.To = "notmy@realemailaddress.com"
            memo.Subject = "Testing"
            memo.Body = "Hello there"
            memo.Attachments.Add(attachment, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue)
            memo.Send()
        Catch ex As Exception
            Console.WriteLine(ex.Message)
        End Try

    End Sub


End Class

When I comment out the attachment line it works perfectly fine, otherwise it throws a COMError. I haven’t been able to find any real good information about attaching an email that way, or if it’s even possible. If I can’t do it this way I plan on just saving the file to some random(ish) name in C:\TEMP\, but it would be nicer if I didn’t have to worry about that.

Thanks for any help

  • 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-16T17:23:20+00:00Added an answer on May 16, 2026 at 5:23 pm

    Here are your options: Attachment Types

    The source information here can help also:Attachment Add Function

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

Sidebar

Related Questions

sending mail along with embedded image using asp.net I have already used following but
I trying to display image in picture box. The application have two part. First
In vb.net i have one panel in which multiple picture box controls are added.
I would like to have a picture like: I'd like it displayed in the
I have a picture box which reads in an image from a folder to
I am using ASP.NET 2.0. I have Image and ImageButton Side by Side by
I have an Image control in my asp.net page. I gave an image url
I have an image in a repeater in ASP.NET. I need to set the
I have an image element with src pointing to an Handler (asp.net), and this
I am attaching an asp.net textbox image I want my textbox should have two

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.