Send STMP mail activity not throwing error and not sending mail in Production machine

Hello Team,

Send stmp mail not sending mail and not throwing error in Production machine but sending mail in development machine with same Server and Port details.

Is there anyway I can manually check server and port in development and production machine to find the results.

Any suggestions would be helpful

Hi @ramesh_kumar5 ,

If the same SMTP server + port works from Development but mail neither sends nor throws an error in Production, the first thing I’d check is whether Production can actually establish a connection to the SMTP server/port.
You can manually test this from both machines.

  1. Test SMTP port using PowerShell
    Run this on Development and Production:
    Test-NetConnection <SMTP_SERVER> -Port <SMTP_PORT>

Example:
Test-NetConnection smtp.company.com -Port 587

Look for:
ComputerName : smtp.company.com
RemotePort : 587
TcpTestSucceeded : True

Hi @ramesh_kumar5 Since it is working on the development machine, this looks more like a connectivity issue on the production machine.

Can you run below command in PowerShell on both machines and compare the result?

Test-NetConnection <SMTP_Server> -Port

Check whether TcpTestSucceeded is True.

If it is failing only in production, check with your network team whether that SMTP port is blocked by firewall or any network policy.

Also set ContinueOnError to False in the Send SMTP Mail activity. That should help you get the actual error instead of the workflow continuing without showing the failure.

Hi @ramesh_kumar5 ,
Check these steps once:

  1. Test SMTP connectivity
    • Open Command Prompt on both Dev and Prod machines:
      telnet <SMTP_Server>
      Test-NetConnection <SMTP_Server> -Port
    • If Prod cannot connect, there may be a firewall, network, or proxy issue.
  2. Verify SMTP settings
    • Compare Server, Port, SSL/TLS, Username, and Password between Dev and Prod.
    • Ensure credentials are not expired or restricted to specific machines.
  3. Check UiPath Robot logs
    • Increase logging level to Verbose and review Execution Logs for hidden SMTP warnings.
  4. Check mail server logs
    • If you have access, verify whether the SMTP server is receiving the request from the Production machine.
  5. Test with a simple PowerShell script
    • Send a test email outside UiPath to determine whether the issue is UiPath-related or infrastructure-related.

Thanks

I have tried but its getting error as my current Port data type is string and i am getting error as cannot fonvert value to System.Int32

Also ContinueonError property is empty

@ramesh_kumar5 The Port field expects an Int32, so if your port is stored as a String, use:

CInt(YourPortVariable)

For example:

CInt(SMTPPort)

Once the datatype issue is fixed, try again in Production. If it still doesn’t send, run this directly on the Production machine:

Test-NetConnection -Port

If TcpTestSucceeded is False, then the issue is outside UiPath, most likely firewall/network or SMTP relay access from the Production machine.

Hi @ramesh_kumar5 ,

You can convert String to Int using

CInt(YourPortDataVariable) or Convert.ToInt32(YourPortDataVariable)

The Port properties in Send SMTP requires integer value

Hi @ramesh_kumar5

You can check the SMTP server and port from both Dev and Prod using:

Test-NetConnection <SMTP_Server> -Port <Port>

Run this on both machines and compare the results. If it works in Dev but not in Prod, check the firewall/network restrictions on the Production machine.

Hi @ramesh_kumar5,

Can you check the Event Viewer on the Production machine to see if anything is being captured there? Also, could you share the exact error message you are getting?

Thanks!

As server port contains text and Port datatype should be Int32 I am passing port value as Convert.Toint32(“Text”) but i am getting error as Input string not in a correct format

@ramesh_kumar5 I’d start by running Test-NetConnection against the SMTP server and port from both DEV and PROD.

If it fails only in PROD, it’s most likely firewall/network related.

If it succeeds in both, then compare SSL/TLS, credentials and sender/relay permissions. I’d also temporarily make sure ContinueOnError is False so the activity doesn’t hide the actual exception.

If you have access to the SMTP server logs, they’re also very useful: no connection from PROD points to network, while a connection followed by rejection points more toward authentication or relay permissions.

Can you try using a hard-coded value 587 for the Port field, without quotes?

Thanks!

I have checked manually in Powershell and its giving TcpTestSucceeded is true but still not able to send mail and also i have updated the UiPath mail package version to 1.24.2

Hi @ramesh_kumar5 ,

does your dev and prod machines have the same permissions related to SMTP?

Usually PROD machines will have more security around. Also check the user/account/email from PROD, will probably not be the same, is not check permissions or asset configurations!

Can you check?

Thank you

@ramesh_kumar5 if TcpTestSucceeded is True and the activity completes without an exception, the SMTP server has most likely accepted the message. The mail is then being dropped or quarantined after that point, not in UiPath.

Two things I’d check:

  1. Add a Log Message right after Send SMTP Mail Message (server, port, From, To) and confirm it appears in the PROD job logs. That also rules out a Try Catch swallowing the error, or the activity sitting in a branch that doesn’t run in PROD.
  2. Ask the mail team for a message trace on the From address around the PROD run time. PROD often uses a different credential/From asset, and relay or spam rules may not accept that sender or the PROD server’s IP.