Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using MAPISESSION controls 2

Status
Not open for further replies.

jh0401

Computer
Apr 8, 2002
32
US
I am trying to automate the process of sending a drawing via email to customers. When I sign on to the mapi session, a message box pops up to ask what to sign on to. Does anyone know how to avoid this? Also, I get this message when I try to generate the email(from OUTLOOK)
"No transport provider was available for delivery to this recipient." I've noticed that for some reason the mail recipient's address has ' ' around it. Could anyone please help? Here's the code:

Public Sub Send_eMail()

If MAPISession1.SessionID = 0 Then 'SEE IF IN SESSION
MAPISession1.SignOn
End If

MAPIMessages1.SessionID = MAPISession1.SessionID

'Compose new message
MAPIMessages1.Compose

'Address Message
MAPIMessages1.RecipDisplayName = g_By
MAPIMessages1.RecipAddress = g_Email

'Create the message
MAPIMessages1.MsgSubject = "Drawing request: " & g_Num
MAPIMessages1.MsgNoteText = " Your Drawing is attached in an EDRW(eDrawings) format."

'Add attachment
MAPIMessages1.AttachmentPathName = App.Path & "\eDrawings\" & g_Num & ".EDRW"

'Send the message
MAPIMessages1.Send False

If MAPISession1.SessionID > 0 Then 'SEE IF IN SESSION
MAPISession1.SignOff
End If

End Sub

Thanks,

Josh
 
Replies continue below

Recommended for you

How can you handle the "no transport provider was available for delivery to this recipient" problem. I have the similar code and I am using Microsoft Exchange.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top