Sending email from ms Access using CDO , Problem ?
-
Hello ! i'm developping an ms-access database , and i need to send emails with attachment.i use CDO to send emails. this is my code : ------------------------------------------------- Dim cdoConfig As Object Dim msgOne As Object With cdoConfig.Fields .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.yahoo.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myusername" .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword" .Update End With Set msgOne = CreateObject("CDO.Message") Set msgOne.Configuration = cdoConfig msgOne.To = "adress@hotmail.com" msgOne.From = "myusername@yahoo.com" msgOne.Subject = "test" msgOne.TextBody = "this is a test" msgOne.AddAttachment "c:\test.txt" msgOne.Send ------------------------------------------------- The code is working but only sometimes.So i send email , no error is displaying , but the email is not received , or in rare cases the email arrive after 3-4 hours or more.but in 30 emails sended only 1 or 2 arrives. Is very strange because i don't get any error message. Can you help me ! Thank you in advance.
-
Hello ! i'm developping an ms-access database , and i need to send emails with attachment.i use CDO to send emails. this is my code : ------------------------------------------------- Dim cdoConfig As Object Dim msgOne As Object With cdoConfig.Fields .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.yahoo.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myusername" .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword" .Update End With Set msgOne = CreateObject("CDO.Message") Set msgOne.Configuration = cdoConfig msgOne.To = "adress@hotmail.com" msgOne.From = "myusername@yahoo.com" msgOne.Subject = "test" msgOne.TextBody = "this is a test" msgOne.AddAttachment "c:\test.txt" msgOne.Send ------------------------------------------------- The code is working but only sometimes.So i send email , no error is displaying , but the email is not received , or in rare cases the email arrive after 3-4 hours or more.but in 30 emails sended only 1 or 2 arrives. Is very strange because i don't get any error message. Can you help me ! Thank you in advance.
Maybe Yahoo mail can be slow! Try to use gmail smtp and see if same happens with gmail too. Pershendetje!
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
Maybe Yahoo mail can be slow! Try to use gmail smtp and see if same happens with gmail too. Pershendetje!
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
Hello ! Thank you for your response. Is the same thing with gmail, hotmail , yahoo and with other domains.The emails are too slow ore never received.Another thing that i notice today is that mos of CDO emails that are received , are marked as spams.When i send emails with the same accounts but not with CDO everything is OK. What can i do ? Thank you.
-
Hello ! i'm developping an ms-access database , and i need to send emails with attachment.i use CDO to send emails. this is my code : ------------------------------------------------- Dim cdoConfig As Object Dim msgOne As Object With cdoConfig.Fields .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.yahoo.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myusername" .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword" .Update End With Set msgOne = CreateObject("CDO.Message") Set msgOne.Configuration = cdoConfig msgOne.To = "adress@hotmail.com" msgOne.From = "myusername@yahoo.com" msgOne.Subject = "test" msgOne.TextBody = "this is a test" msgOne.AddAttachment "c:\test.txt" msgOne.Send ------------------------------------------------- The code is working but only sometimes.So i send email , no error is displaying , but the email is not received , or in rare cases the email arrive after 3-4 hours or more.but in 30 emails sended only 1 or 2 arrives. Is very strange because i don't get any error message. Can you help me ! Thank you in advance.
Mail sent using CDO is sent from the machine you're running it from. I believe there's a way to send the mail via a mail server by using server (I could be wrong); however, due to security concerns this isn't often done. Most firewall and anti-virus applications will also catch this sort of thing unless it's configured to allow mail to be sent out. I would recommend interop with outlook, since the libraries for this are available when outlook is installed. http://support.microsoft.com/kb/310263[^] Working in an exchange environment, I wound up using MAPI for one of my solutions. A quick search on CP for "MAPI" will yield several options for you.
-
Mail sent using CDO is sent from the machine you're running it from. I believe there's a way to send the mail via a mail server by using server (I could be wrong); however, due to security concerns this isn't often done. Most firewall and anti-virus applications will also catch this sort of thing unless it's configured to allow mail to be sent out. I would recommend interop with outlook, since the libraries for this are available when outlook is installed. http://support.microsoft.com/kb/310263[^] Working in an exchange environment, I wound up using MAPI for one of my solutions. A quick search on CP for "MAPI" will yield several options for you.
-
Thank you ! But i want to send email from inside my application without open outlook window.I have all the information like SMTP server , username , password , smtp port ...etc.so what's wrong with CDO ?Is CDO usable or not ?
CDO will work if you're only ever sending to a single address and you have your anti-virus/firewall configured to allow emails to be sent out originating from your computer; and if you allow spam from your origin address on the destination account. If you're looking to email end users with a non-static address, I recommend looking into other solutions.