Link to home
Start Free TrialLog in
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...
ASKER CERTIFIED SOLUTION
Avatar of cool12399
cool12399

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of trunks222
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.
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
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.
please delete the question, no one is helping out...
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