Hi Guru, I am trying to send email using CDONTS but the email is not sent and a message "Email is sent" is shown. Please, inform me what's wrong with the code below, thank's for your help;

Sub SendEmail(ByVal From As String, ByVal sendto As String, ByVal subject As String, _
ByVal EmailText As String, Optional ByVal Attachment As String)

Dim rseomail As CDONTS.NewMail

On Error GoTo NextTry

Set rseomail = CreateObject("CDONTS.NewMail")
rseomail.From = From ' "[email protected]"
rseomail.To = sendto ' "[email protected]"
rseomail.subject = subject ' "Re: Email testing"
rseomail.Body = EmailText ' "This is to test email CDONTS"
rseomail.attachfile (Attachment) ' "c:a.txt"
rseomail.Importance = 0
rseomail.Send
MsgBox "Email is sent."
Exit Sub

NextTry:
Call SendEmailOutlook(sendto, subject, EmailText, Attachment)


End Sub