Run time error - 2147220973 (80040213) The transport failed to connect to the server while sending mail from vb6 - vb.net

I am making one application in vb6 which sends mail from an application, it gives me
Run time error - 2147220973 (80040213) The transport failed to contact
to the server
, I did all the given solution gives before
Please help if any one knows solution.
Code:
code:
{
mStrProcName = "MonthlyXlMail_EmployeePerformance"
sFilePath = (App.Path & "\TimeTaken.xls")
iConf.Load -1
Set Flds = iConf.Fields
Set lobj_cdomsg = New CDO.Message
lobj_cdomsg.Configuration.Fields(cdoSMTPServer) = Trim(rsMail!ServerUrl)
lobj_cdomsg.Configuration.Fields(cdoSMTPServerPort) = CInt(Trim(rsMail!Port))
lobj_cdomsg.Configuration.Fields(cdoSMTPUseSSL) = IIf(rsMail!ReqSSL = "Y", True, False)
lobj_cdomsg.Configuration.Fields(cdoSMTPAuthenticate) = cdoBasic
lobj_cdomsg.Configuration.Fields(cdoSendUserName) = Trim(rsMail!EMailID)
lobj_cdomsg.Configuration.Fields(cdoSendPassword) = Trim(rsMail!EmailPassword)
lobj_cdomsg.Configuration.Fields(cdoSMTPConnectionTimeout) = 30
lobj_cdomsg.Configuration.Fields(cdoSendUsingMethod) = cdoSendUsingPort
lobj_cdomsg.Configuration.Fields.Update
lobj_cdomsg.To = Trim(strMail)
lobj_cdomsg.From = Trim(rsMail!EMailID)
lobj_cdomsg.Subject = IIf(Len(Trim(txtsubject.Text)) = 0, "Performance Report", Trim(txtsubject.Text))
lobj_cdomsg.TextBody = IIf(Len(Trim(txtDescription.Text)) = 0, "Find Attachment", Trim(txtDescription.Text))
'lobj_cdomsg.HTMLBody = strMsg
lobj_cdomsg.AddAttachment (sFilePath)
lobj_cdomsg.Send
}

Are you using Gmail with Two factor auth? This also prevents using smtp with basic authentication.
Create a custom app in you Gmail security settings to add a new password for your messaging application.
1. Login into your Gmail account
2. Goto https://security.google.com/settings/security/apppasswords
3. Choose 'Custom' app.
4. Typ 'Gmail Smtp', or something
5. Click 'Generate'
6. It will give you a password token.
Use this token as your password in your messaging application instead of your own password.

Related

Drobox API Upload Not Working For Business Users

Earlier i have used Dropbox api on personal user account and all goes very fine.
Now, i need to do the same, but this time account is a business account user. I have tried for hours but can't find a working way to upload the file.
Here is my code that i tried:
objDHTTP = New Chilkat.Http
objDHTTP.UnlockComponent("")
objDHTTP.HeartbeatMs = 125
objDHTTP.ConnectTimeout = 60
objDHTTP.ReadTimeout = 60
objDJSON = New Chilkat.JsonObject
objDJSON.AppendString("path", "/test.pdf")
objDJSON.AppendString("mode", "overwrite")
objDJSON.AppendBool("autorename", False)
objDJSON.AppendBool("mute", True)
objDRequest = New Chilkat.HttpRequest
objDRequest.UsePost()
objDRequest.Path = "/2/files/upload"
objDRequest.AddHeader("Content-Type", "application/octet-stream")
objDRequest.AddHeader("Dropbox-API-Select-User", "dbmid:member_id") 'Note-1
objDRequest.AddHeader("Authorization", "Bearer auth_token") 'Note-2
objDRequest.AddHeader("Dropbox-API-Arg", objDJSON.Emit)
objDRequest.StreamBodyFromFile(strLocalFile)
objDResponse = objDHTTP.SynchronousRequest("content.dropboxapi.com", 443, True, objDRequest)
objDJSON.Dispose()
objDJSON = Nothing
If (objDResponse Is Nothing) Then
strDBReturn = "Call failed!"
Else
strDBReturn = objDResponse.BodyStr.Trim
objDResponse.Dispose()
objDResponse = Nothing
End If
objDRequest.Dispose()
objDRequest = Nothing
Code is in vb.net and i use chilkat libray for http and json part.
but it's very easy to understand the code.
Note-1: i have set the header to select member.
Note-2: first i tried Dropbox API, then i am tring Dropbox Business API
it's shows in the response that file is upload and also shows the same path as the http request.. but i can't find the file in the Dropbox (from browser) :(
Here is the DB Response Example:
{"name": "test1.pdf", "path_lower": "/test1.pdf", "path_display": "/test1.pdf", "id": "id:7fQPQ7pubtAAAAAAAAAAFQ", "client_modified": "2018-10-01T13:46:24Z", "server_modified": "2018-10-01T13:46:24Z", "rev": "cee6f9f90", "size": 204181, "content_hash": "318bc8a4b25c3c319b558dda011a8e837caa0dee2b84e1c7deb0d0405bad1bf0"}
any help will be highly appreciated..
thanks in advance
best regards

Datadog monitor API/terraform process monitor check

I'm trying to integrate a Datadog monitor check on sshd process in my terraform codebase, but I'm getting datadog_monitor.host_is_up2: error updating monitor: API error 400 Bad Request: {"errors":["The value provided for parameter 'query' is invalid"]}
What I did was to copy the monitor's query I created on the Datadog panel and pasted it into the tf file:
resource "datadog_monitor" "host_is_up2" {
name = "host is up"
type = "metric alert"
message = "Monitor triggered"
escalation_message = "Escalation message"
query = "process.up.over('process:ssh').last(4).count_by_status()"
thresholds {
ok = 0
warning = 1
critical = 2
}
notify_no_data = false
renotify_interval = 60
notify_audit = false
timeout_h = 60
include_tags = true
silenced {
"*" = 0
}
}
ofc the query example "avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo} by {host} > 2" works
What's the right way to check via Datadog API or terraform if a specific service, like sshd, is up or not?
There are two error in your code:
The type used is wrong. It should be service check instead of metric alert.
You need to enclose process.up in a pair of ''.
Once done, your code will run flawlessly.

vb.net connecting to MQ server

I migrated app from vb6 to vb.net, every thing is working fine except getting the message from the MQ server, when MQGet called, I get 2033 error (no Message)
also attached the capture message that sent to MQ from working vb6 and from not working vb.net, please help?enter image description here
'***********************************
'Send(MQPUT) to MQSeries and CICS
'***********************************
PutMsgOpts = MQPMO_DEFAULT
MsgDesc = MQMD_DEFAULT
MsgDesc.Persistence = MQPER_PERSISTENT
MsgDesc.MsgId = MQMI_NONE.Value
MsgDesc.CorrelId = "AMQ!NEW_SESSION_CORRELID" 'if using MQBridge
MsgDesc.ReplyToQ = gReplyToQ
MsgDesc.ReplyToQMgr = gMQRplyMgrName
MsgDesc.Format_Renamed = MQFMT_STRING
'sPutMsg is composed of 8 byte program name(host/cics)
' plus data desired to pass as string only (dfcommarea)
'************ MAX LENGTH IS 32776 *******************
sPutMsg = gCICSPrgName & gsHost_Msg
If Len(sPutMsg) <> 32768 Then
sPutMsg = sPutMsg & Space(32768 - Len(sPutMsg))
End If
sMsgIdGet.Value = MsgDesc.MsgId
'*******************************************
'MQClose the queue for request sent to host
'*******************************************
'HOST-BYPASS
MQCLOSE(Hconn, Hobj, MQCO_NONE, cC, Reason)
'HOST-BYPASS
'**********************************************************
'MQOpen the queue for receiving the request from the host
'**********************************************************
'set up the queue name
ObjDesc = MQOD_DEFAULT
ObjDesc.ObjectName = gReplyToQ
'Open
'HOST-BYPASS
MQOPEN(Hconn, ObjDesc, MQOO_INPUT_AS_Q_DEF Or MQOO_FAIL_IF_QUIESCING, Hobj, cC, Reason)
'HOST-BYPASS
'Hconn is set by MQseries in the Connect
'**************************************
'Receive (MQGET) from MQSeries and CICS
'**************************************
GetMsgOpts = MQGMO_DEFAULT
GetMsgOpts.Options = MQGMO_WAIT Or MQGMO_CONVERT
GetMsgOpts.WaitInterval = 10000 '20 seconds
MsgDesc = MQMD_DEFAULT
MsgDesc.Format_Renamed = MQFMT_STRING
MsgDesc.Persistence = MQPER_PERSISTENT
MsgDesc.CorrelId = sMsgIdGet.Value 'set correlId with MQGET msgid returned
MsgDesc.MsgId = MQMI_NONE.Value
MsgDesc.ReplyToQ = gReplyToQ
MsgDesc.ReplyToQMgr = gMQRplyMgrName
'** sGetMsg is composed of 8 byte program name(host/cics)
'** plus data desired to pass as string only (dfcommarea)
'************ MAX LENGTH IS 32776 *******************
sGetMsg = New String(" ", 32768)
'Command to receive from to MQSeries and CICS
retryCount = 0
cC = MQCC_OK + 1
Reason = 2033
Do While cC <> MQCC_OK And Reason = 2033
MQGET(Hconn, Hobj, MsgDesc, GetMsgOpts, Len(sGetMsg), sGetMsg, readlen, cC, Reason)
retryCount = retryCount + 1
If retryCount > 1 Then Exit Do
Loop
'************************
'MQClose queue for input
'************************
MQCLOSE(Hconn, Hobj, MQCO_NONE, cC, Reason)
If you get 2033, then you know the queue is there, but the message you are trying to retrieve is not. Use MQ Explorer or plain MQ samples along with runmqsc to check if there are any messages on that queue, and if there are, if their correlation id matches what your program is supplying.
If there are no messages there, then check that your messages have been indeed received by the CICS program your are sending them to, and if that program responded.
A 2033 problem may be your coding problem, but more probably it's something in the configuration and setup that has changed along with your conversion. You may have a differently configured queue manager, with differently configured channels etc. Check the entire chain.

DSocuSign Reminders & NOtifications

I have enabled reminders and expiration in DocuSign. But when a document is sent to a user, it does not seem to work.
I'm using SOAP APIs on C#.
DocuSignAPI.Notification ntf = new DocuSignAPI.Notification();
DocuSignAPI.Reminders rem = new DocuSignAPI.Reminders();
rem.ReminderEnabled = true;
rem.ReminderEnabled = true;
rem.ReminderDelay = 5;
rem.ReminderFrequency = 3;
DocuSignAPI.Expirations exp = new DocuSignAPI.Expirations();
exp.ExpireEnabled = true;
exp.ExpireAfter = 90;
exp.ExpireWarn = 3;
I set the values to 2016 and noticed that expiration was working but reminders are not. After sending the documents, I could not see the reminders set on the DS web site, if I tried to correct the document.

how to connect facebook through xmpp dll in vb.net?

I tried the code below to connect to Facebook through Agsxmpp.Dll, but when I connect to it, it shows login failed on OnAuthError Event. How do I solve this?
ObjAgx = New XmppClientConnection
ObjAgx.Server = "chat.facebook.com"
ObjAgx.Username = txtusername.text
ObjAgx.Password = txtPassword.Text
ObjAgx.Port = 5222
ObjAgx.AutoResolveConnectServer = False
objAgx.open()
Is there any method to connect to Facebook using xmpp?
Here is the right Code :
ObjAgx = New XmppClientConnection
ObjAgx.Server = "chat.facebook.com"
ObjAgx.Username = txtusername.text
ObjAgx.Password = txtPassword.Text
ObjAgx.Port = 5222
ObjAgx.AutoResolveConnectServer = True
ObjAgx.UseSSL = False
ObjAgx.ConnectServer = "Facebookmail.com"
ObjAgx.open()
you must turn off ssl to connect to facebook and use the connectserver as you see in the code above .
NOTE : AutoResolveConnectServer is needed and it's IMPORTANT .
Happy Coding ^^