Click here to Skip to main content
16,016,500 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalupgrade from vb picturebox to vb.net picturebox Pin
khangwoi22-Nov-03 9:28
khangwoi22-Nov-03 9:28 
Generalerrors on calling excel.sheets methods Pin
pnpfriend22-Nov-03 9:05
pnpfriend22-Nov-03 9:05 
GeneralInheriting/Expanding the DataGrid Pin
Gibble21-Nov-03 9:47
Gibble21-Nov-03 9:47 
GeneralObject Libraries in Outlook Pin
dhynamite21-Nov-03 4:50
dhynamite21-Nov-03 4:50 
GeneralRe: Object Libraries in Outlook Pin
Cliff Wellman21-Nov-03 7:56
Cliff Wellman21-Nov-03 7:56 
GeneralRe: Object Libraries in Outlook Pin
dhynamite22-Nov-03 1:34
dhynamite22-Nov-03 1:34 
GeneralRe: Object Libraries in Outlook Pin
Cliff Wellman22-Nov-03 18:40
Cliff Wellman22-Nov-03 18:40 
GeneralSending attachments using MAPI and outlook security alert message. Pin
alexander13221-Nov-03 4:33
alexander13221-Nov-03 4:33 
Hi Friends,
i have written code in VB .net for sending mail using MAPI.
I am facing two problems.
1. The mail does go, but when i give an attachment, it gives the following exception.
System.Runtime.InteropServices.COMException (0x800A7D02): Unspecified Failure has occurred
at MSMAPI.MAPIMessagesClass.Send(Object vDialog)
at ProcTryMail.tryMail.Pr_SendMail() in D:\Projects\Ems\Backup_Nov17OutSeq\ProcTryMail\tryMail.vb:line 30

MSDN says this occurs when multiple attachments are put.

2. when i finally send mail, i get an outlook warning saying:
A program is trying to automatically send e-mail on your behalf. Do you want to allow this? If this is unexpected, it may be a virus and you should choose "No".

The code is given below.

Public Class tryMail
Private objMapiSession As MSMAPI.MAPISession
Private objMapiMsgs As MSMAPI.MAPIMessages
Private objDebug As EMSDebug.cDebug
Public Sub Pr_SendMail()
Try
objMapiSession = New MSMAPI.MAPISession()
objMapiMsgs = New MSMAPI.MAPIMessages()
objMapiSession.LogonUI = False
objMapiSession.SignOn()
objMapiMsgs.SessionID = objMapiSession.SessionID
objMapiMsgs.Compose()
objMapiMsgs.RecipDisplayName = "-- give a mail id here --"
objMapiMsgs.MsgSubject = "From .NET MAPI"
objMapiMsgs.AttachmentPathName = "-- give a filepath here --"
objMapiMsgs.Send(False)
objMapiSession.SignOff()
objMapiSession = Nothing
objMapiMsgs = Nothing
Catch
End Try
End Sub
End Class

thanks
Alex
GeneralRe: Sending attachments using MAPI and outlook security alert message. Pin
Dave Kreskowiak21-Nov-03 7:45
mveDave Kreskowiak21-Nov-03 7:45 
GeneralCalling a Dialup connection Pin
FerryEngels21-Nov-03 4:27
FerryEngels21-Nov-03 4:27 
GeneralRe: Calling a Dialup connection Pin
Sisira Pushpakumara27-Nov-03 17:49
sussSisira Pushpakumara27-Nov-03 17:49 
QuestionHow to get URL in an ActiveX Pin
peteralarsen20-Nov-03 23:02
peteralarsen20-Nov-03 23:02 
GeneralConnect to a remote datbase Pin
pradipta20-Nov-03 21:34
pradipta20-Nov-03 21:34 
GeneralProblem while sending mail from Windows service using MSMAPI Pin
alexander13219-Nov-03 20:23
alexander13219-Nov-03 20:23 
GeneralRe: Problem while sending mail from Windows service using MSMAPI Pin
Dave Kreskowiak20-Nov-03 9:56
mveDave Kreskowiak20-Nov-03 9:56 
GeneralRe: Problem while sending mail from Windows service using MSMAPI Pin
alexander13221-Nov-03 3:28
alexander13221-Nov-03 3:28 
QuestionHow to do this C# unsafe pointer passing in VB.NET Pin
the_warlord19-Nov-03 15:32
the_warlord19-Nov-03 15:32 
AnswerRe: How to do this C# unsafe pointer passing in VB.NET Pin
Dave Kreskowiak20-Nov-03 9:58
mveDave Kreskowiak20-Nov-03 9:58 
AnswerRe: How to do this C# unsafe pointer passing in VB.NET Pin
Dave Kreskowiak21-Nov-03 4:02
mveDave Kreskowiak21-Nov-03 4:02 
GeneralRe: How to do this C# unsafe pointer passing in VB.NET Pin
the_warlord21-Nov-03 12:24
the_warlord21-Nov-03 12:24 
GeneralRe: How to do this C# unsafe pointer passing in VB.NET Pin
Dave Kreskowiak24-Nov-03 4:19
mveDave Kreskowiak24-Nov-03 4:19 
GeneralDynamic function calls in VB Pin
Cliff Wellman19-Nov-03 10:21
Cliff Wellman19-Nov-03 10:21 
GeneralRe: Dynamic function calls in VB Pin
Michael P Butler19-Nov-03 12:54
Michael P Butler19-Nov-03 12:54 
GeneralRe: Dynamic function calls in VB Pin
MS le Roux19-Nov-03 18:30
MS le Roux19-Nov-03 18:30 
GeneralRe: Dynamic function calls in VB Pin
Dave Kreskowiak20-Nov-03 9:29
mveDave Kreskowiak20-Nov-03 9:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.