locked
Send email when Outlook is not open RRS feed

  • Question

  • I was able to send an email but when I do not have outlook open, I get this message...
    Profile name is not valid.  Enter a valid profile name.   Do I need to supply authentication?

    Private mmapi As Microsoft.Office.Interop.Outlook.NameSpace
    Private memail As MailItem Private mapp As Application
    Public Sub New()
    mapp = New Application
    End Sub
    Friend Sub Login(ByVal user As String, ByVal password As String)
    mmapi = mapp.GetNamespace("mapi")
    mmapi.Logon(user, password)
    End Sub

    Wednesday, September 22, 2010 1:14 PM

Answers

  • Usually you do not need to supply authentication. The profile name is usually just "Outlook" unless specifically set. In most cases I would just use a blank logon: Logon("", "", false, false)

    --
    Ken Slovak
    [MVP - Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007.
    Reminder Manager, Extended Reminders, Attachment Options.
    http://www.slovaktech.com/products.htm
     
     
    "markinro" <=?utf-8?B?bWFya2lucm8=?=> wrote in message news:a168881c-6135-4b69-80cc-30d148925264...
    I was able to send an email but when I do not have outlook open, I get this message...
    Profile name is not valid.  Enter a valid profile name.   Do I need to supply authentication?

    Private mmapi As Microsoft.Office.Interop.Outlook.NameSpace
    Private memail As MailItem Private mapp As Application
    Public Sub New()
    mapp = New Application
    End Sub
    Friend Sub Login(ByVal user As String, ByVal password As String)
    mmapi = mapp.GetNamespace("mapi")
    mmapi.Logon(user, password)
    End Sub


    Ken Slovak MVP - Outlook
    • Marked as answer by markinro Wednesday, September 22, 2010 2:06 PM
    Wednesday, September 22, 2010 2:00 PM