Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski 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
Joined
Apr 8, 2002
Messages
32
Location
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
 
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