Email to domain names assigned to gmail

blogmk

Registered User.
Local time
Today, 16:44
Joined
Jun 6, 2013
Messages
27
Hi,

I need to send email with attachment on click of a button. We use emails like name@basepost.biz which is assigned to gmail.

I tried the following code but it throws transport to server error.

Dim cdoConfig
Dim msgOne

Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 465
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.basepost.biz"
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "name"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

Set msgOne = CreateObject("CDO.Message")
Set msgOne.Configuration = cdoConfig
msgOne.To = "customer@gmail.com"
msgOne.From = "support@basepost.biz"
msgOne.Subject = "Test email"
msgOne.TextBody = "It works just fine third time also"
msgOne.Addattachment "c:\users\..."
msgOne.send

Please advice
 
EDIT: Okay, looks like you have added a bit more information. Well which line is that the Error is thrown?

That seriously is the vaguest description I have ever come across. Please look at
How to talk to a programmer

 
Last edited:
"The transport failed to connect to the server" is the error exception caught in button click event.
 
"The transport failed to connect to the server" is the error exception caught in button click event.
This has already been established in your first post.. What I was asking was..
Well which line is that the Error is thrown?
When the error occurs the Erro message box pops up, if you click Debug button instead of End/Continue/Help you would be taken to the LOC which caused the error, highlighting it in Yellow color..
 
Hi,

It doesn't do so in this case. Its just a information msg box with OK button in it.

Thanks
 
Okay, so have you done the following...

1. Compiled the Code prior to Execution?

2. Added the appropriate Microsoft CDO for Windows 2000 Library Reference?

In your LOC, you have..
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 465
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.basepost.biz"
Should the first one not be present or should it be a different config like smtpport or smtptimeout or something? Comment that out and see if you have any luck.
 
Tried commenting the line but still throws the same error...
 
Could you please upload a Stripped version of your DB?

How to Upload a Stripped DB.

To create a Sample DB (to be uploaded for other users to examine); please follow the steps..

1. Create a backup of the file, before you proceed..
2. Delete all Forms/Queries/Reports that are not in Question (except the ones that are inter-related)
3. Delete auxiliary tables (that are hanging loose with no relationships).
4. If your table has 100,000 records, delete 99,990 records.
5. Replace the sensitive information like Telephone numbers/email with simple UPDATE queries.
6. Perform a 'Compact & Repair' it would have brought the Size down to measly KBs..
7. (If your Post count is less than 10 ZIP the file and) Upload it..

Finally, please include instructions of which Form/Query/Code we need to look at. The preferred Access version would be A2003-A2007 (.mdb files)
 

Users who are viewing this thread

Back
Top Bottom