Use Send message without attachements (wodSmtp)
Hi,
I can use sendmessage with attachments successfully. However, when the message doesn't contain attachments the message doesn't send.
Thanks,
Nightwalker
Re: Use Send message without attachements
Nightwalker,
Saying doesn't work doesn't really help. Do you receive an error? Which one?
Can you provide me with Transcript property output?
Regards,
Damba
Re: Use Send message without attachements
Nightwalker,
Saying doesn't work doesn't really help. Do you receive an error? Which one?
Can you provide me with Transcript property output?
Regards,
Damba
I don't receive an error! However, I fixed the problem by putting the end if straight after the next statement like so:
Public Function SimpleMapiSend()
'8/8/2010
'Check for attachments.
If frmAttachments.LstFiles.ListCount <> 0 Then
For a = 0 To frmAttachments.LstFiles.ListCount - 1
Smtp.Message.attach (frmAttachments.LstFiles.List(a))
Next a
End If
With Smtp
' Add the sender
.Message.From = frmSettings.txtUsername.Text
'Add the recipent
.Message.To = frmCompose.txtTo.Text
'Add the message subject
.Message.Subject = frmCompose.txtSubject.Text
'Add the message body
.Message.Text = frmCompose.txtBody.Text
'Send the message
.SendMessage
End With
End Function
Whereas before I had the End if after the End With .