Avatar of trunks222
trunks222
 asked on

runtime error 2147220960 (80040220) The SendUsing configuration is invalid

Hi. Im trying to send an email from VB6
here is the code:

'Set objmail = CreateObject("CDO.Message")
       
        'objmail.To = "info@X"
        'objmail.From = "register@X"
        'objmail.subject = "Request for new user"
        'objmail.textbody = "Company name: " & RName & vbCr & "Contact name: " & Cie & vbCr _
         '   & "Email: " & txtEmail.Text & vbCr & "Phone number: " & txtPhone.Text & _
         '   vbCr & vbCr & txtMes.Text
           
        'Me.MousePointer = 11
        'objmail.send
        'Me.MousePointer = 0

It works fine on all the computers in my company, but when other companies try to use the program I created, they get:

"runtime error 2147220960 (80040220)  The SendUsing configuration
value is invalid".

I checked a lot of websites and couldn't really find a good solution for VB6.

Could anyone help?
I think it has to do with the anonymous smtp stuff...
Visual Basic Classic

Avatar of undefined
Last Comment
trunks222

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
cool12399

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
trunks222

ASKER
whats the command to use a SMTP server?
I could use an SMTP server with a log/pass.
but I just dont know the commands to use
and when u do objX.   -> it does not show you a list of all available methods.
So that's the information I'm missing.
Pi7

if you're using   microsoft outlook, it's propably because those computers have not been configured to send mails using outlook.

With the SMTP server, the address of the server has to be known by the program
trunks222

ASKER
no no no...

Its a VB application, where I have a FORM that when you click onto register, it sends directly from that form an email... It has nothing to do with outlook express as far as I know :/

in the mail object, there is supposed to be something with the SMTP that you can set up. with a login and a password.
and I think that's the missing thing so that my mail object would work on any station.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
trunks222

ASKER
please delete the question, no one is helping out...
trunks222

ASKER
the code does not work at all I had to change the whole code.
use this instead...

Dim iMsg As New CDO.Message
Dim iConf As New CDO.Configuration
Dim Flds As ADODB.Fields
Set Flds = iConf.Fields

        With Flds
          .Item(cdoSendUsingMethod) = cdoSendUsingPort
          .Item(cdoSMTPServer) = SMTP
          .Item(cdoSMTPConnectionTimeout) = 10 ' quick timeout
          .Item(cdoSMTPAuthenticate) = cdoBasic
       
          ' IMPORTANT: Storing user names and passwords inside source code
          ' can lead to security vulnerabilities in your software. Do not
          ' store user names and passwords in your production code.
          .Item(cdoSendUserName) = ""
          .Item(cdoSendPassword) = ""
       
          .Item(cdoURLProxyServer) = "server:80"
          .Item(cdoURLProxyBypass) = "<local>"
          .Item(cdoURLGetLatestVersion) = True
          .Update
        End With
       
        With iMsg
          Set .Configuration = iConf
              .To = """NAME"" <EMAIL@EMAIL.EM>"
              .From = """Registration"" <FROM@FROM.COM>"
              .Subject = "Request for new user"
              .TextBody = "text"
              '.AddAttachment "C:\files\mybook.doc"
              Me.MousePointer = 11
              .Send
              Me.MousePointer = 0
        End With