Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Bad login or password error with OLD SRP_Send_Mail

Greetings!
I understand this utility is old, perhaps not supported.
The utility worked fine when I installed it over a year ago. It does not get used much if at all.
Yesterday I was testing the web site that uses it and found emails not being sent.
Did the deep dive today and all I've learned is:
Bad login or password .
Here is my config:
Config = ""
Config<1> = SendUsing_Port$
Config<3> = 465 //port For ssl encription
Config<4> = mailservername //smtp.gmail.com
Config<5> = 1
Config<6> = username
Config<7> = password
Config<8> = "SSL"

I've checked my login credentials and they seem OK. (other successful logins)

Any thoughts?

Have fun,
Paxton

Comments

  • Gmail no longer supports SSL. Try using port 587 and setting Config<8> to "TLS". If that doesn't work, you might need to upgrade SRP Mail.
  • Thanks, Kevin.
  • Kevin,
    I downloaded version 3.0.1
    Installed and compared my code with SRP_MAIL_DEMO_EVENTS and I must be missing something as neither 1 for success nor an error message is returned.

    Compile subroutine html_sendEmail(message,doc,dest)
    Declare Function Msg, dce_address, dce_copyright, Inet_QueryParam
    Declare Function SRP_Mail, nametitle, date_time
    .
    .
    .
    mailmessage = ''
    mailmessage <1> = subject
    mailmessage <2> = sendername //i.e. info@thedce.com
    mailmessage <3> = recipient
    mailmessage <4> = cc
    mailmessage <5> = bcc
    mailmessage <6> = '' //reply To (defaults To sendername
    mailmessage <7> = email_body_type
    mailmessage <8> = form
    mailmessage <9> = '' // An @VM delimited list of paths to files to be attached. (Full paths only. No relative paths)
    mailmessage <10> = ""

    Config = ""
    Config<1> = '' // Send Using is deprecated
    Config<3> = 465 //port For SSL encription
    Config<4> = mailservername
    Config<5> = 1
    Config<6> = username
    Config<7> = password
    Config<8> = "SSL"

    retval = SRP_Mail(mailMessage, Config)
    isOK = retval
    debug

    Ideas where to look? Thanks.
    Have fun, holiday weekend listen for you Tuesday!
    Paxton
  • Paxton - Your code suggests you are still trying to use SSL. Did you try TLS and port 587?
  • Same result. retval is blank, nothing. Not 1 or error message
    Paxton
  • edited September 2023
    Try "TLS12" on Config<8>.
  • Kevin,
    Hate to report, but "TLS12" on Config<8>. produces the same result. i.e. nothing :-)
    I'm on a Windows 11 machine that is also having issues with some Coffee Cup software. It shows error in the event viewer log. Nothing shows for send_mail. Don't think it is related, but being as transparent as I can.
    Have fun,
    Paxton
  • The fact that you're getting nothing leads me to believe that SRP_Send_Mail is actually just not getting called. Can you make sure there aren't additional copies of $SRP_SEND_MAIL in SYSOBJ? Also, since SRP Mail 3.0 relies on RevDotNET, you might to run the Client installer again for OI to make sure everything is properly registered.
  • Kevin,
    I checked for $SRP_SEND_MAIL in SYSOBJ. Only one and nothing else close.
    I uninstalled and re installed revdotnet. I uninstalled from windows programs and features.
    I installed by running .\Oinsight\Clientfiles\revdotnetsetup.msi. And I then checked Windows Update to insure up it was up to date
    I got errors trying to install using .\Oinsight\ClientInstall\Setup.exe.
    I got errors using .\Oinsight\ClientSetup.exe
    As I remember, I think the errors indicated that the REV installer could not fine the windows .msi files

    Pretty sure that revdotnet was installed ok before doing anything as I used LIST from the command line and results ready to print were displayed correctly.

    Then tried running the SRP_Mail function with config 8 set to TSL. (port 587) No joy
    Tried TSL12 / port 587
    Same. nothing returned
    My debug is a couple of statements after the function is called.

    Checked the LIST in the command line again to be sure and it failed . So Ran \Oinsight\ClientSetup.exe again and this time recorded the messages
    Installing Client 9.1.1 Setup:
    RevSoft message said installed successfully but immediately got Windows Installer message:
    "This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vender to verify that this is a valid Windows Installer package."
    click OK
    Get same message again
    click OK
    Get same message again
    Click OK
    Then got the closing Revsoft window and can click the finish button
    Now the Command Line LIST statement works again.
    Tested SRP_Mail again with TSL an TSL12
    Same results.
    Next?
    Have fun,
    Paxton
    (Apologize for being so long-- full disclosure)
  • Oh, try calling SRP_Send_Mail instead of SRP_Mail. SRP_Mail is a convenient wrapper, which you are welcomed to use, but it has totally different parameters.
  • Kevin,
    I've got it all tangled up now.
    I have both $SRP_SEND_MAIL and $SRP_MAIL in SYSOBJ (and $SRPMAIL_DEMO_EVENTS)
    In SYSPROCS I have SRP_MAIL_DEMO_EVENTS (for config reference)
    I must have some errors in my config as I am getting a "SRP_SEND_MAIL, line37. Too many parameters" SRP_SEND_MAIL is called. I've tried several configs withouth luck. I'm backsliding :-(
    mailmessage = ''
    mailmessage <1> = subject
    mailmessage <2> = sendername //i.e. info@thedce.com
    mailmessage <3> = recipient
    mailmessage <4> = cc
    mailmessage <5> = bcc
    mailmessage <6> = '' //reply To (defaults To sendername
    mailmessage <7> = email_body_type
    mailmessage <8> = form
    mailmessage <9> = '' // An @VM delimited list of paths to files to be attached. (Full paths only. No relative paths)
    mailmessage <10> = 1
    //mailmessage <11> = ""
    //mailmessage <12> = ""

    Config = ""
    Config<1> = '' // Send Using is deprecated
    Config<3> = 587 //port For SSL encription
    Config<4> = mailservername
    Config<5> = 1
    Config<6> = username
    Config<7> = password
    Config<8> = "TLS"

  • Are you calling SRP_Mail or SRP_Send_Mail in your code? You should be calling the latter.
  • Kevin,
    I apologize for taking so much of your time. Here is the entire procedure:
    Hope it is not too confusing.
    *******************************************************************************
    Compile subroutine html_sendEmail(message,doc,dest)
    Declare Function Msg, dce_address, dce_copyright, Inet_QueryParam
    Declare Function SRP_send_Mail, nametitle, date_time

    /***************************************************************************
    called from verify and inet_dce acton code save(from xml_table and html_profile
    welcome msg) also from Profile to change email

    //moving these functions to html_email...to be deprecated
    *****************************************************************************/
    $insert DCESYS_EQUATES
    $insert ALBUMS_EQUATES
    $insert TITLESB_EQUATES
    $insert TITLESV_EQUATES
    $Insert WEBUSERS_EQUATES
    $insert SRPMAIL_INSERTS

    Equate TRUE$ To 1
    Equate FALSE$ To 0
    // action_code = trim(inet_queryParam(message,"ACTION_CODE"))
    updateadmin = trim(inet_queryParam(message,"updateadmin"))
    create_flag = trim(inet_queryParam(message,"create"))

    If Len(create_flag) Else
    create_flag = trim(inet_queryParam(message,"dce_create"))
    If create_flag = 1 Then create_flag = "YES"
    end
    album_key = trim(inet_queryParam(message,"album_key"))
    table = trim(inet_queryParam(message,"media"))
    new_flag = trim(inet_queryParam(message,"new_flag"))
    email_change= trim(inet_queryParam(message,"email_change"))
    seller = trim(inet_queryParam(message,"seller"))
    email_body_type = trim(inet_queryParam(message,"email_body_type"))
    If Len(email_body_type) Else email_body_type = "HTML"
    htdocs = doc<1>
    params = doc<2>
    If Len(params) Then
    seller = params<1,1>
    album_key = params<1,2>
    table = params<1,3> // table is ALBUMS, TITLESB, etc
    send_flag = params<1,4>
    upc = params<1,5>

    begin case
    case send_flag = "sendin"
    // called from HTML_verify to notify a send in requirement.
    * no longer used - sept 20, 2008 -- need to check others
    seller = params<1,1>

    Case send_flag = "tradein"
    foraway = "for"
    title = nametitle(table,album_key)
    create_flag = send_flag
    trader = params<1,1>
    Case send_flag = "tradeout"
    foraway = "away"
    title = nametitle(table,album_key)
    create_flag = send_flag
    trader = params<1,1>
    Case 1
    doc = "Error in HTML_sendmail, bad send flag:":send_flag
    return
    End case

    End

    welcome_form = "welcome.html"
    tradein_form = "tradenotice.html"

    If updateadmin = 1 Then
    // this will be for a message when profile it updated...
    doc = "OK^Update Successful!"
    Return
    End
    // above turn off, ???

    char1 = album_key[1,1]
    If alpha(char1) Then
    // must start with A or T so drop first character
    album_key = album_key[2,Len(album_key)]
    End

    If create_flag = "YES" else

    If create_flag[1,1] = "%" then
    doc = "OK^Update Successful!"
    Return
    End

    Begin Case
    Case create_flag = "tradein"
    // "continue"

    Case email_change = "Yes"
    // continue
    Case table = "LOCKER"
    table = "ALBUMS"
    title_name = ALBUMS_NAME$
    upc_field = ALBUMS_UPC$
    Case table = "LOCKERA"
    table = "ALBUMS"
    title_name = ALBUMS_NAME$
    upc_field = ALBUMS_UPC$
    Case table = "LOCKERV"
    table ="TITLESV"
    title_name = TITLESV_NAME$
    upc_field = TITLESV_UPC$
    Case table = "LOCKERB"
    table ="TITLESB"
    title_name = TITLESB_NAME$
    upc_field = TITLESV_UPC$
    Case 1
    doc = "^Fell through Cases, No recognized media type. html_sendemail":table
    Return
    End Case

    end

    dcerec = Xlate("DCESYS","MONEY",'','X')
    mailservername = dcerec
    sendername = "info@thedce.com"
    crlf = char(13):char(10)
    email = ''
    fullname = ''
    confirm_link = ''
    username = ''
    password = ''
    dce_address = DCE_Address()
    dce_copyright = DCE_copyright()

    doc = "OK^Update Successful!"

    Begin Case

    Case create_flag = "YES"
    gosub welcome
    case create_flag = "tradein"
    Gosub tradein
    Case Len(album_key)
    Gosub album_trade

    Case email_change = "Yes"
    Gosub email_change
    Case 1
    return
    End Case

    params = crlf:"---------parms----------------------"
    params := crlf:html_document
    params := crlf:mailservername
    params := crlf:sendername
    params := crlf:recipient
    params := crlf:subject
    params := crlf:email_body_type
    params := crlf:body
    params := crlf:"(cc) ":cc
    params := crlf:"(bcc) ":bcc
    params := crlf:username
    params := crlf:password

    //retval = smtpmail(html_document, mailservername, sendername, recipient, subject, body, cc,bcc, username, password)
    mailmessage = ''
    mailmessage <1> = subject
    mailmessage <2> = sendername //i.e. info@thedce.com
    mailmessage <3> = recipient
    mailmessage <4> = cc
    mailmessage <5> = bcc
    mailmessage <6> = '' //reply To (defaults To sendername
    mailmessage <7> = email_body_type
    mailmessage <8> = form
    mailmessage <9> = '' // An @VM delimited list of paths to files to be attached. (Full paths only. No relative paths)
    mailmessage <10> = ''
    mailmessage <11> = ''
    mailmessage <12> = ''

    Config = ""
    Config<1> = '' // Send Using is deprecated
    Config<2> = '' ; // Server Directory is deprecated
    Config<3> = 587 //port For SSL encription
    Config<4> = mailservername
    Config<5> = 1
    Config<6> = username
    Config<7> = password
    Config<8> = "TLS"

    retval = SRP_send_Mail(mailMessage, Config)
    isOK = retval
    debug
    Swap @fm With crlf In config
    Swap @fm With crlf In mailmessage
    //isOK = Index(retval,"250",1)
    If isOK = 1 Else
    doc = "Failure sending email. (":retval:")"
    OSWrite retval On "c:\1temp\SRP_send_mail_error.txt"
    End
    retval = "smtp server response:":crlf:retval
    retval :=crlf:date_time(2)
    retval := crlf:"------------------config:":crlf:config:crlf:"----------mailmessage":crlf:mailmessage
    oswrite retval on "c:\1temp\mailsend.txt"
    Return
    ******************************************************************************
    ****************************************************************************
    welcome:
    /* The present time and date set the random number generator with a unique value. */
    username = trim(inet_queryParam(message,"rowid"))
    If Len(username) Else
    username = trim(inet_queryParam(message,"dce_buyerusername"))
    end
    user_key = username
    convert @lower_case to @upper_case in user_key
    email = XLATE("WEBUSERS", user_key,"EMAIL", "X")
    OSWrite "from html_sendemail":crlf:"username: ":username:crlf:"email: ":email On "c:\1temp\welcome.txt"
    InitRnd Time(): Date()
    password = Rnd(10000) +1
    sysrec = "JOINER"
    Open "DCESYS" To hdcesys Else
    // throw bad error
    ok = 0
    Return
    End

    Unlock hdcesys,sysrec Then
    end
    Lock hdcesys,sysrec else
    If sysrec_locked else
    a=0
    Loop
    Lock hdcesys,sysrec then
    sysrec_locked = TRUE$
    End else
    For ctr = 1 To 1000
    a += 1
    Next ctr
    End
    If a = 10000 Then
    errorMsg = "Can not lock system record NEW PASSWORD. "
    ok = 0
    Return
    End
    Until sysrec_locked
    Repeat
    End
    End

    Read dcesysrec From hdcesys,sysrec Else
    dcesysrec = ''
    end

    // availablePasswords = dcesysrec
    //Locate password In availablePasswords setting pos Then
    dcesysrec = password ; //new password
    allpasswords = dcesysrec
    // insure all at same position
    Locate password In allpasswords setting pos then
    dcesysrec = date_time()<1> ; //datetime
    dcesysrec = username
    dcesysrec = email

    Write dcesysrec On hdcesys,sysrec else
    ok = 0
    errorMsg = "Can not write NEW PASSWORD date to system record."
    Return
    End

    End
    /*
    End Else
    ok = 0
    errorMsg = "Can not read system record to record JOINER."
    Return
    end
    */

    Unlock hdcesys,sysrec Then
    end
    password = "email456"
    fullname = Xlate("WEBUSERS", user_key,"FULLNAME","X")

    dcelink = ''
    dcelink :='Click here to complete theDCE registration
    '

    OSread form from htdocs:"emails\":welcome_form then

    Swap "%%LOGO%%" With dest In form
    Swap "%%USERNAME%%" with username in form
    Swap "%%FULLNAME%%" With fullname In form
    Swap "%%PASSWORD%%" with password in form
    Swap "%%EMAIL%%" with email in form
    Swap "%%DCE_ADDRESS%%" with dce_address in form
    Swap "%%DCE_COPYRIGHT%%" with dce_copyright in form
    Swap "%%CONFIRM_LINK%%" with dcelink in form

    OSWrite form on htdocs:"emails\sent\welcome_":user_key:".html"
    End else
    errorCode = status()
    End

    dcerec = Xlate("DCESYS","MONEY",'','X')
    html_document = htdocs:"emails\sent\welcome_":user_key:".html"

    Recipient = email
    Subject = fullname:" New member welcome to theDCE"
    Body = "theDCE Welcome"
    CC = ""
    BCC = dcerec
    Swap @vm With "," In bcc
    Username = dcerec
    Password = dcerec
    OSWrite "end welcome" On "c:\1temp\endwelcome.txt"
    return
    ****************************************************************************
    ****************************************************************************
    email_change:
    username = trim(inet_queryParam(message,"username"))
    user_key = username
    convert @lower_case to @upper_case in user_key
    // used For change email
    password = "email456"
    fullname = Xlate("WEBUSERS", user_key,"FULLNAME","X")
    email = XLATE("WEBUSERS", user_key,WEBUSERS_UNCONFIRMED_EMAIL$, "X")
    security_code = XLATE("WEBUSERS", user_key,WEBUSERS_SECURITY_CODE$, "X")
    Login_flag = XLATE("WEBUSERS", user_key,WEBUSERS_LOGIN_FLAG$, "X")
    dcelink = ''
    dcelink :='Click here to login and complete your Email Address change.
    '

    OSread form from htdocs:"emails\email_change.html" then

    Swap "%%LOGO%%" With htdocs In form
    Swap "%%USERNAME%%" with username in form
    Swap "%%FULLNAME%%" With fullname In form
    Swap "%%PASSWORD%%" with password in form
    Swap "%%EMAIL%%" with email in form
    Swap "%%DCE_ADDRESS%%" with dce_address in form
    Swap "%%DCE_COPYRIGHT%%" with dce_copyright in form
    Swap "%%CONFIRM_LINK%%" with dcelink in form

    OSWrite form on htdocs:"emails\sent\email_":user_key:".html"
    End else
    errorCode = status()
    End

    dcerec = Xlate("DCESYS","MONEY",'','X')
    html_document = htdocs:"emails\sent\email_":user_key:".html"

    Recipient = "<":email:">"
    Subject = fullname:" Email Address Change."
    Body = "DCE Member Email address change"
    CC = ""
    BCC = dcerec
    Swap @vm With "," In bcc
    Username = dcerec
    Password = dcerec

    return
    ****************************************************************************
    *********************************************************************************
    album_trade:

    seller_key = seller
    convert @lower_case to @upper_case in seller_key
    password = Xlate("WEBUSERS", seller_key,"PASSWORD","X")
    fullname = Xlate("WEBUSERS", seller_key,"FULLNAME","X")
    email = XLATE("WEBUSERS", seller_key,"EMAIL", "X")
    dcelink = ''
    dcelink :='Click here to send In your album (CD).
    '

    album_name = trim(Xlate(table, album_key, title_name,'X'))
    If Len(album_name) Else
    album_name = "--Title name not available. Click the link To check your locker ":album_key:"--"
    End
    upc = trim(Xlate(table, album_key, upc_field,'X'))
    OSread form from htdocs:"emails\strade.html" then

    Swap "%%LOGO%%" With htdocs In form
    Swap "%%ALBUM%%" With album_name In form
    Swap "%%FULLNAME%%" with fullname in form
    Swap "%%EMAIL%%" with email in form
    Swap "%%DCE_ADDRESS%%" with dce_address in form
    Swap "%%DCE_COPYRIGHT%%" with dce_copyright in form
    Swap "%%SEND_LINK%%" with dcelink in form
    Swap "%%UPC%%" With upc In form

    OSWrite form on htdocs:"emails\sent\strade_":seller_key:".html"
    End else

    errorCode = status()

    End


    dcerec = Xlate("DCESYS","MONEY",'','X')


    html_document = htdocs:"emails\sent\strade_":seller_key:".html"

    Recipient = email
    Subject = fullname:" theDCE trade send-in requirment."
    Body = "One of your unverified albums has be sold or traded away, please send it in."
    CC = ""
    BCC = dcerec
    Swap @vm With "," In bcc
    Username = dcerec
    Password = dcerec

    return
    **********************************************************************************
    **********************************************************************************
    tradein:
    username = trader
    user_key = username
    convert @lower_case to @upper_case in user_key
    fullname = Xlate("WEBUSERS", user_key,"FULLNAME","X")
    email = XLATE("WEBUSERS", user_key,"EMAIL", "X")
    * dcelink = ''
    * dcelink :='Click here to complete theDCE registration
    '

    OSread form from htdocs:"emails\":tradein_form then

    Swap "%%LOGO%%" With htdocs In form
    Swap "%%USERNAME%%" with username in form
    Swap "%%FULLNAME%%" With fullname In form
    Swap "%%FORWAY%%" with foraway in form
    Swap "%%TITLE%%" with title in form
    Swap "%%DCE_ADDRESS%%" with dce_address in form
    Swap "%%DCE_COPYRIGHT%%" with dce_copyright in form
    // Swap "%%CONFIRM_LINK%%" with dcelink in form

    OSWrite form on htdocs:"emails\sent\trade_":user_key:".html"
    End else
    errorCode = status()
    End

    dcerec = Xlate("DCESYS","MONEY",'','X')
    html_document = htdocs:"emails\sent\tradein_":user_key:".html"

    Recipient = "<":email:">"
    Subject = fullname:" theDCE Trading Notice"
    Body = "theDCE Trading Notice":crlf
    CC = ""
    BCC = "<":dcerec<DCESYS_EMAIL_ADRS$>:">"
    Swap @vm With ">;<" In bcc
    Username = dcerec<DCESYS_SMTP_USERNAME$>
    Password = dcerec

    return


    ***********************************************************************************
    default:
    ********


    html_document = htdocs:"emails\":welcome_form

    Sendername = ""
    Recipient = "<":dcerec<DCESYS_EMAIL_ADRS$>:">"
    Swap @vm With "," In recipient
    Subject = "New member welcome ERROR to theDCE"
    Body = "bad action code in sendemail"
    BCC = ""
    //CC = "<":dcerec<DCESYS_NEW_USER_COPY$>:">"
    cc = recipient
    Username = dcerec
    Password = dcerec


    Return
    **********************************************************************************************
  • Line 37 is the call to start up RevDotNet. What version of OI are you on?
  • Kevin,
    OpenEngine version 9.1.1
    Client Install says 9.0
    I also have oecgi3
    (not that it matters)

    Paxton
  • That explains it. SRP Mail was built using .NET 4, which requires at least OI 9.3. Email security has advanced over the years, so we changed platforms to keep up. I highly recommend upgrading OI.
  • Thanks, Keven.
    Apologize for the trouble. Probably just use php.
    Have fun,
    Paxton
Sign In or Register to comment.