|
-
March 14th, 2006, 11:04 PM
#1
Problem with CDONTS email
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
-
March 15th, 2006, 02:46 AM
#2
Re: Problem with CDONTS email
 Originally Posted by gracesup
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
hi,
in attachfile you have missed the slash "\"
and you are not closing the cdonts object.
thanks
-
March 15th, 2006, 02:49 AM
#3
Re: Problem with CDONTS email
CDONTS line length is limited to 74 characters, if you are trying to send more than this, then it might create a problem.
regards
-
March 15th, 2006, 08:26 PM
#4
Re: Problem with CDONTS email
Hi, thank's for trying but it still does not work after I add "\" , close the cdonts object, and the text is less than 74 char.
Last edited by gracesup; March 15th, 2006 at 08:41 PM.
-
March 16th, 2006, 12:37 AM
#5
Re: Problem with CDONTS email
 Originally Posted by gracesup
Hi, thank's for trying but it still does not work after I add "\" , close the cdonts object, and the text is less than 74 char.
I think the main problem is with your SMTP service configuration,config the SMTP properly delivering email.
You can check the mailroot for outgoing mails.If the mails are there just config SMTP properly.
Rudraksh
-
March 17th, 2006, 12:15 AM
#6
Re: Problem with CDONTS email
Hi Rudraksh, I think you are right, I checked the mailroot and the outgoing mails are there. I config the SMTP for a single computer with IP 127.0.0.1 but it still doesn't work. Could it be my ISP that prevents emailing from vb or I didn't config correctly? Thank's for your info.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|