Error in send-mailmessage command

Hello,
I am executing the powershell command  to send mails from internal SMTP Server but when am executing this command getting error as "Unable to connect to the remote server".I have checked no port blocking this ,no anti virus is installed. the
machine have permission to relay the mail.
Please help me to resolve the issue.
Thanks 
RICHA KM

Are you using an alternate port for SMTP? Send-MailMessage has a parameter to specify an alternate port to use if that is the case. If you run the following command (replace 'computername' and 'port' with the system you are attempting to connect to)...
(New-Object Net.Sockets.TCPClient -ArgumentList "Computername","Port").Connected
...does it come back as true for the open port?
Boe Prox
Blog |
Twitter
PoshWSUS |
PoshPAIG | PoshChat |
PoshEventUI
PowerShell Deep Dives Book

Similar Messages

  • Send-Mailmessage command not working always

    Hi Experts,
    When i execute scripts with send-mailmessage command it works sometimes and sometimes it is not working :(
    i believe this is due to timeout issue or the server is busy at the time of script execution. Please find the error message below
    I need to make sure this command works and we get emails because I'm planning to make this script in schedule job.
    is there anyway to write a script like if this commands show this error, execute same command until it sends the email.
    Regards, Nidhin.CK

    Hi Rhys,
    Sorry above mentioned code was not working so i tried below code and its working fine
    $i = 0
    Do{
    $MailError = $null
    try{
    Send-MailMessage -SmtpServer $smtpservername -To $toaddress -From $fromaddress -Subject $subject -Body $body -BodyAsHtml -ErrorAction Stop
    catch{
    $MailError = $_.Exception.Message
    if ($MailError -ne $null){
    $i++
    Write-Output "[SOX1] - " $i
    Start-Sleep -Seconds 5
    } else {
    $i = 0
    }while ($i -ne 0)
    Regards, Nidhin.CK

  • "An error occurred sending the command to the application" When trying to open excel document from outlook 2007

    Error message "An error occurred sending the command to the application" When trying to open excel document from outlook 2007.
    OS: Windows Server 2008 R2
    If I save the document then it opens fine, messing with default file associations does not resolve this problem, I've googled for ir it and some suggest unticking compatibility mode or "run as admin" for excel application, neither is selected in my case.
    Outlook is configured to run as remote application from remoteApp server, this error is only occurring for one user, for others excel documents open just fine.

    Hi
    Thank you for using
    Microsoft Office for IT Professionals Forums.
    From your description, we can Create a trusted location follow these steps
    Click the Microsoft Office Button , and then click Excel Options.
    Click Trust Center, click Trust Center Settings, and then click
    Trusted Locations.
    If you want to create a trusted location that is not local to your computer, select the Allow trusted locations on my network (not recommended) check
    box.
    Click Add new location.
     IMPORTANT   We recommended that you don't make your entire
    Documents or My Documents folder a trusted location. Doing so creates a larger target for a hacker to potentially exploit and increases your security risk. Create a subfolder within Documents or My Documents, and make only that folder a trusted location.
    In the Path box, type the name of the folder that you want to use as a trusted location, or click Browse to
    locate the folder.
    If you want to include subfolders as trusted locations, select the
    Subfolders of this location are also trusted check box.
    In the Description box, type what you want to describe the purpose of the trusted location.
    Click OK.
    More detailed information you can refer to this link:
    http://office.microsoft.com/en-us/word-help/create-remove-or-change-a-trusted-location-for-your-files-HA010031999.aspx?CTT=1#BM12
    Please take your time to try the suggestions and let me know the results at your earliest convenience. If anything is unclear or if there is anything
    I can do for you, please feel free to let me know.
    Hope that helps.
    Sincerely
    William Zhou CHN
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • TCP connection error when sending MODBUS commands to WAGO 750-881 controller after 113655 bytes of data have been sent

    Hi all,
    I am new to the world of labview and am attempting to build a VI which sends commands to a 750-881 WAGO controller at periodic intervals of 10ms. 
    To set each of the DO's of the WAGO at once I therefore attempt to send the Modbus fc15 command every 10ms using the standard Labview TCP write module. 
    When I run the VI it works for about a minute before I recieve an Error 56 message telling me the TCP connection has timed out. Thinking this strange, I decided to record the number of bytes sent via the TCP connection whilst running the program. In doing so I noticed that the connection broke after exactly 113655 Bytes of data had been sent each time. 
    Thinking that I may have been sending too many messages I increased the While-loop delay from 10ms to 20, 100 and 200 ms but the error remained. I also tried playing with the TCP connection timeout and the TCP write timeout but neither of these had any effect on the problem. 
    I cannot see why this error is occuring, as the program works perfectly up untill the 113655 Bytes mark. 
    I have attached a screenshot of the basic VI (simply showing a MODBUS command being sent every second) and of a more advanced VI (where I am able to control each DO of the WAGO manually by setting a frequency at which the DO should switch between ON and OFF). 
    If anybody has any ideas on where the problems lie, or what I could do to further debug the program this would be greatly appreciated. 
    Solved!
    Go to Solution.
    Attachments:
    Basic_VI.png ‏84 KB
    Expanded_VI.png ‏89 KB

    AvdLinden wrote:
    Hi ThiCop,
    Yes the error occurs after exactly 113655 bytes every time. The timeout control I would like to use is 10ms, however even increasing this to 1s or 10s does not remove the error, which leads me to believe that this is not the issue (furthermore, not adding any delay to the while loop, thus letting it run at maximum speed, has shown that the TCP connection is able to send all 113655 bytes in under 3 seconds again pointing towards the timeout control not being the issue here). 
    I attempted Marco's suggestion but an having difficulty translating the string returned into a readable string, (rightnow the response given is "      -#   +   ").
    As to your second suggestion, I implemented something similar where I created a sub VI to build a TCP connection, send a message and then close the connection. I now build each message and then send the string to this subVI which successfully sends the command to my application. Whilst not being the most elegant method of solving the issue, it has resolved the timeout problem meaning I am able to send as many commands as I want. So in that sense the problem has been solved. 
    If you still have tips on how to correctly read the TCP read output, I would however like to see if I could not get my first program to work as it is slightly more robust in terms of timing. 
    Modbus TCP RTU is a binary protocol, as you show in your Basic VI, where you format the data stream using byte values. So you have to interprete the returned answer accordingly with the Modbus RTU spec in hand. Now what is most likely happening is that the connection gets hung after a while since you do NOT read the data the device sends as response to your commands. The TCP/IP stack buffers those bytes and at some point the internal buffers overflow and the connection is blocked by the stack. So adding the TCP Read at strategic places (usually after each write) is the proper solution for this. Is there any reason that you didn't use the NI provided Modbus TCP library?
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Powershell send-mailmessage error - helo command rejected: need fully-qualified

    did you try the From and To email addresses in the format of
    "User01 "
    "User02 "
    Like the examples here?
    https://technet.microsoft.com/en-us/library/hh849925.aspx

    Hello,I need help with sending e-mails via Powershell using SMTP authentication. I've described the problem here on StackOverflow already:
    http://stackoverflow.com/questions/31542444/powershell-send-mailmessage-error-helo-command-rejected-...Re-pasting here: """I've read many sources regarding this issue, but no luck :/I am trying to use Powershell 4.0 (Windows server 2012 R2) to send e-mails via the Send-MailMessage commandlet in this way:PHP$From = "[email protected]"$To = "[email protected]"$Subject = "e-mail odeslany z powershellu :)"$Body = "..."$SMTPServer = "smtp.mydomain.cz"$SMTPPort = "587"$credentials = new-object Management.Automation.PSCredential “[email protected]”, (“xxxpasswordxxx” | ConvertTo-SecureString -AsPlainText -Force)Send-MailMessage -From $From -to $To -Subject $Subject -Body $Body -SmtpServer...
    This topic first appeared in the Spiceworks Community

  • Powershell : Send-MailMessage -Body paramenters is not working with commands like (Get-ExchangeServer) etc

    I am trying to send email from Powershell .
    When i run this:
    Send-MailMessage -From "[email protected]" -To "[email protected]" -Subject "Test email" -Body  "This is Test Email" -SmtpServer "mail01.xxx.xx"
    then i successfully receive email .
    But when i try to use other commands in -Body parameter then it gives error:
    For example:
     Send-MailMessage -From "[email protected]" -To "[email protected]" -Subject "Test email"
    -Body (Get-ExchangeServer) -SmtpServer "mail01.xxx.xx"
    Send-MailMessage : Cannot convert 'System.Object[]' to the type 'System.String'
     required by parameter 'Body'. Specified method is not supported.
    At line:1 char:96At line:1 char:116
    + Send-MailMessage -From "[email protected]" -To "[email protected]" -Subject "Test email" -Body (Get-ExchangeServer <<<< ) -SmtpServer "mail01.xxx.xx"
        + CategoryInfo          : ObjectNotFound: (Get-ExchangeServer:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    My requirement is to send email from powershell and send exchange related data in email.

    OK I got it .. The solution is to add Out-String
    Send-MailMessage -From "[email protected]" -To "[email protected]" -Subject "Test email"
    -Body (Get-ExchangeServer | Out-String) -SmtpServer "mail01.xxx.xx"

  • When i click on an excel or word file in 2007 the program begins to open but then an error message says There was a problem sending the command to the program

    when i click on an excel or word file in 2007 the program begins to open but then an error message says There was a problem sending the command to the program.
    i am using office2007  with windows7 premium home edition.  i have checked file associations., all DDE settings. i have even tried this in safe mode. the same thing happens. please note once i see the error. i can then go back to the file click on
    it a second time and it WILL open. AND i can open any file if i open excel and and find the file from there. i uninstalled and re-installed office 2007 from scratch. And i checked the compatibility mode (all un-checked) still the problem persisits. this is
    a real PITA.   anyone have any solution for this? Thanks 
    ken yanow

    Hi,
    Have you try to un-select the Ignore other applications that use Dynamic Data Exchange (DDE) setting?
    Click the Microsoft Office Button, and then click Excel Options.
    Click Advanced, and then click to clear the Ignore other applications that use Dynamic Data Exchange (DDE)
    check box in the General area.
    Click OK.
    If the problem cannot resolve, the Run as administrator may selected.
    Go to Office default install location: C:\Program Files\Microsoft Office\Office12.
    Right-click EXCEL.EXE > Properties >
    Compatibility tab.
    Under Privilege Level, uncheck Run this program as an administrator
    check box.
    Best regards.
    William Zhou
    TechNet Community Support

  • Using VI Example Basic Serial Write Read to send AT commands to Cell phone modem error 1073807360

    I am using the NI Example VI: Basic Serial Write and Read to send AT commands to a Cell phone acting as a Modem.  I can send AT commands to this phone using Hyperterm when I select the modem driver by name in the hypert port selection field but not as com 7 which it occupies according to device manager modem properties. The basic serial vi does not show the modem driver as a selection, only ports by comX are shown. I get error 1073807360.

    Have you tried to put the name you enter in Hyperterminal in the VISA resource control? If Com 7 doesn't show, you can simply type "COM 7" in the VISA resource control. Or use "ASRL::INSTR 7".
    Also, make sure the connection in hyperterminal is closed, before you open the port in LabVIEW.
    Hope it helps,
    Wiebe.

  • After updating to Firefox 3.6.9, when I click on a link in Outlook email, I get a message which says "General failure. The URL was: .... An error occurred in sending the command to the applicatio." and the link will not open. How can I fix this?

    I updated Firefox yesterday to 3.6.9. When I receive a URL link in an email within Outlook, I cannot open the link in Firefox. As I said in the question, when I click on the link, a Microsoft Office Outlook error message appears which states that a General failure has occurred in sending the command to the application (which is Firefox). I am using Office 2007 This did not occur prior to the upgrade of Firefox.

    See this lnk for a fix, it worked for me!
    http://www.pcworld.com/article/200103/fix_outlook_general_failure_error_for_email_links.html

  • Since switching to Firefox this week, when I click on a hyperlink in an e-mail in Outlook, I get this message, "General failure. An error occurred in sending the command to the application." It doesn't open a new window or do anything.

    Since switching to Firefox this week, when I click on a hyperlink in an e-mail in Outlook, I get this message, "General failure. An error occurred in sending the command to the application." It doesn't open a new window or do anything. Any work around to fix this?

    See this lnk for a fix, it worked for me!
    http://www.pcworld.com/article/200103/fix_outlook_general_failure_error_for_email_links.html

  • Excel won't open and error message There was a problem sending the command to the programe

    Hi there
    I'd be grateful for your help.
    I've just bought a new laptop and installed Office 2013.  I used Excel 2013, did what I needed to do and saved it.  This was 5 days ago.
    Today, I've tried opening the file from my desktop and get the error message 'There was a problem sending the command to the program'.
    And when I try to open Excel to do the DDE fix, which seems to be the best suggestion, I can't open Excel at all.  I've tried to get into it from the Apps screen.
    Any help would be gratefully appreciated.
    Thanks

    Don't seem like this can be fixed so I went back to version 6.0.2 which works good.
    I have Chrome now as my default browser and will not use fire fox until they fix it!
    Chrome works great!

  • Using Firefox 4 & Windows 7. Everytime I start Firefox from a shortcut to a website it comes up with the following error 'there was a problem sending the command to the program'. The requested website does load after this. with no problems.

    Using Firefox 4 & Windows 7. Everytime I start Firefox from a shortcut to a website it comes up with the following error 'there was a problem sending the command to the program'. The requested website does load after this. with no problems.
    If a shortcut is used while Firefox is already open the error does not occur.

    As reported in earlier replies, the annoyance disappeared after I upgraded to Roboform 7.5.6, from 7.5.4.
    Regards, Steve

  • After updating to 3.6.10 links in Outlook 2007 no longer open - "An error occurred in sending the command to the application"

    After updating to Firefox 3.6.10 this morning, Outlook 2007 can no longer open up links embedded in emails. Normally when you clicked a link it would open up Firefox and send you to the website, but when you click on any link it now says:
    General failure. The URL was: [url here]
    An error occurred in sending the command to the application.
    I don't know what happened. I didn't change any other settings on the computer.
    I am running Windows 7 64 Professional, MS Outlook 2007 with latest updates, and Firefox 3.6.10

    Please read this article to see if it helps:
    https://support.mozilla.com/tiki-view_forum_thread.php?locale=en-US&comments_parentId=542907&comments_offset=20&comments_per_page=20&forumId=1
    Also, you might try this first:
    https://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

  • Since upgrading to Firefox 4.0 I keep getting the error message "THERE WAS APROBLEM SENDING THE COMMAND TO THE PROGRAM", please can you advise how I get it to stop?

    I have just upgraded to Firefox 4.0 and ever since then I get this message when I try to go to either Yahoo or Gmail
    "THERE WAS A PROBLEM SENDING THE COMMAND TO THE PROGRAM",
    I had this problem a month or so ago so downgraded to Firefox 3.6 and the problem went away but have now been advised to upgrade which indeed I have and hey presto the error message again, please how can I fix it??

    OK, you seem to be running Zone Alarm as your firewall. It includes a utility which checks to see whether a site is safe or not and also adds a plugin to Firefox which is listed as '''npFFApi'''. Can you disable that and see if it makes any difference?
    To get to the plugins manager, click the orange Firefox button, then click "Add-ons". In the page that opens, click the "Plugins" link on the left which will open the menu. Then find '''npFFApi '''and click the "''Disable''" button.

  • When I open Firefox 4 RC1 by clicking an external link (as from my desktop) I get an error: "there was a problem sending the command to the program"

    A box with this error: "there was a problem sending the command to the program" always pops up upon clicking any URL sitting in my desktop (or from any other folder). It will not happen if Firefox is already open. However, it is only an annoyance as the page fully opens with no problem.
    It started after I downloaded Firefox 4 beta ver 12. It continued after upgraded with RC1. It did not happen in my latest version of Firefox 3.6.x which I removed after installing 4 RC1

    This has happened to me many times but on the older FF 3 It could be a small bug, One should list the PC's being used as it could be related? Mine is an E-Machine Mod, W3609 running W7.

Maybe you are looking for

  • XML Web Service ( ? )

    Hello there to everyone reading my post ! I am trying to design an Application that exchanges XML Documents (or messages, I don't know how to call them properly). My application, recieves an XML, reads it, and replies with another XML. I am totally n

  • Keynote Remote not connecting

    Hey everyone, I bought the Keynote Remote App to use with my Keynote 09. They find eachother (the iPhone and the Keynote) but when I try to connect them, it prompts an error on my iPhone after a while.. thus... not connecting. Any ideas? Thanks, Juli

  • What is a build?

    Hello Folks, One of my collageaue keep talking about "Build". What is that/ We are in the process of converting data from a company we are taking over. Thanks, Jess..

  • Material consumption for subcontact

    Hi can any body help me about on subcontracting consumption materals in month wise report.. is there any std LIS for this report..? if it s not can we custmize the LIS..? thank u & regards sesidhar

  • Enter a Material or item catg error in Inbound delivery through idoc

    Hi, When Iam processing inbound delivery through Idocs, iam getting 2 kind of errors 1. Enter a material or item category 2. No item category exists (Table T184L EL 0002 V ) Iam thinking may be this is about not having an entry in T184L table. we hav