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
"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