Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to send the e-mail?

How to send the e-mail?

Scheduled Pinned Locked Moved C#
securityhelptutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vasya dragon
    wrote on last edited by
    #1

    Good afternoon. How to send e-mail that there was no window Outlook Security? public bool Send( string sub, string txt ) { lastMsg = new MapiMessage(); lastMsg.subject = sub; lastMsg.noteText = txt; // set pointers lastMsg.originator = AllocOrigin(); lastMsg.recips = AllocRecips( out lastMsg.recipCount ); lastMsg.files = AllocAttachs( out lastMsg.fileCount ); error = MAPISendMail( session, winhandle, lastMsg, 0, 0 ); // WARNING Outlook SecurityOutlook Security Dealloc(); Reset(); return error == 0; } [DllImport( "MAPI32.DLL")] private static extern int MAPISendMail( IntPtr sess, IntPtr hwnd, MapiMessage message, int flg, int rsv ); private MapiRecipDesc origin = new MapiRecipDesc(); private ArrayList recpts = new ArrayList(); private ArrayList attachs = new ArrayList(); oSession = new MAPI.Session(); oSession.Logon(Missing.Value, Missing.Value, true, true, Missing.Value, Missing.Value, Missing.Value); MAPI.Folder oFolder = (MAPI.Folder)oSession.Outbox; MAPI.Messages oMessages = (MAPI.Messages)oFolder.Messages; MAPI.Message oMsg = (MAPI.Message)oMessages.Add(Missing.Value, Missing.Value, Missing.Value, Missing.Value); MAPI.Recipients oRcpt = (MAPI.Recipients)oMsg.Recipients; oRcpt.Add("SMTP:xxx@xxx.xxx", "SMTP:xxx@xxx.xxx", MAPI.CdoRecipientType.CdoTo, Missing.Value); oRcpt.Resolve(Missing.Value); // WARNING Outlook Security oMsg.Subject = "Test Message"; oMsg.Text = "This is a test message..."; oMsg.Send(Missing.Value, Missing.Value, Missing.Value); oSession.Logoff(); Thanks!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups