|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Change "From" Address dynamically in VB using MAPI Controls
Hi,
Need help to solve my purpose. I am using MAPI Session & MAPI Message Controls to send emails from VB. I am able to send emails without any error. Now I want to send some emails on behalf of another user. That user added me in his delegates list. But his name is not in my profile list. When I am sending emails its taking automatically my profilename and sending. How I can send emails on behalf of another user. Here I am giving my code: Public Function SendMessage(ByVal SendTo As String, ByVal Subject As String, Attachment() As String) As Boolean 'automatically fill up the email server, ie. groupwise with the information 'such as subject and attachment. On Error GoTo Err_Handler Dim I As Integer With m_Form.Message .SessionID = m_Form.Session.SessionID .Compose If Subject <> "" Then .MsgSubject = Subject 'populate the sent to text box automatically if 'the project provides an email address. If Not SendTo = "" Then .RecipIndex = 0 .RecipType = 1 'RECIP_TYPE_TO .RecipDisplayName = SendTo '.RecipAddress = SendTo '.ResolveName End If 'we have to provide more than one space for each attachment. 'otherwise an error will be generated when using groupwise 'outlook does not have this problem. If frmShipment.blshipment = False Then .MsgNoteText = Space(UBound(Attachment) + 1) & vbCrLf _ & "The attached file needs PDF Reader to open, if you don't have the PDF Reader software on your machine, you can download the software FREE from http://www.adobe.com/products/acrobat/alternate.html" Else .MsgNoteText = Space(UBound(Attachment) + 1) End If For I = LBound(Attachment) To UBound(Attachment) If Attachment(I) <> "" Then .AttachmentIndex = .AttachmentCount .AttachmentPosition = .AttachmentIndex .AttachmentPathName = (Attachment(I)) End If Next I If frmUnconfirmedShip.blEmail = True Then .Send False 'send emails directly Else .Send True 'display the send dialog window. End If End With On Error Resume Next AppActivate "Mail From" m_ErrorMessage = "" SendMessage = True Exit Function Err_Handler: m_ErrorMessage = Err.Number & " " & Err.Description SendMessage = False End Function Appreciable for your early response. TQ. |
|
#2
|
|||
|
|||
|
I have the same proble, do you has an answer yet?
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > Change "From" Address dynamically in VB using MAPI Controls |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|