<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ERROR Sending email with sendemail, but alert emails work fine in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22020#M3340</link>
    <description>&lt;P&gt;It is not working for me. Please help me brother.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jun 2017 07:01:43 GMT</pubDate>
    <dc:creator>jitendra0101</dc:creator>
    <dc:date>2017-06-07T07:01:43Z</dc:date>
    <item>
      <title>ERROR Sending email with sendemail, but alert emails work fine</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22012#M3332</link>
      <description>&lt;P&gt;I have my smtp server configured correctly and have setup and do receive plenty of alerts for scheduled searches. However when I attempt to use the &lt;CODE&gt;sendemail&lt;/CODE&gt; command, the following error is displayed:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Errno 10061] No connection could be made because the target machine actively refused it while sending mail to: foo@bar.com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The only error I can find in the logs is from var/log/python.log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2010-07-28 10:18:51,105 ERROR Sending email. subject="Splunk Results", results_link="None", recepients="['foo@bar.comm']"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I haven't been able to find any other errors related to this, and this is the only line in python.log.&lt;/P&gt;

&lt;P&gt;I am using sendemail as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my search terms | sendemail to=foo@bar.com sendresults=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Windows Installation, 4.1.3. What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2010 21:43:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22012#M3332</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2010-07-28T21:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR Sending email with sendemail, but alert emails work fine</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22013#M3333</link>
      <description>&lt;P&gt;The &lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Sendemail" rel="nofollow"&gt;sendemail&lt;/A&gt; command by default attempts to use localhost as the SMTP server and ignores the settings used for scheduled search alerts. If you do not have an SMTP server or forwarder installed (which on Windows is quite likely), &lt;CODE&gt;sendemail&lt;/CODE&gt; will fail when trying to connect to localhost. &lt;/P&gt;

&lt;P&gt;To work around this, specify &lt;CODE&gt;server&lt;/CODE&gt; in &lt;CODE&gt;sendemail&lt;/CODE&gt; as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my search terms | sendemail to=foo@bar.com sendresults=true server=mail.bar.com
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Jul 2010 21:45:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22013#M3333</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2010-07-28T21:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR Sending email with sendemail, but alert emails work fine</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22014#M3334</link>
      <description>&lt;P&gt;I tried this this command and it gives the error like "command="sendemail", Connection unexpectedly closed while sending mail to: &lt;A href="mailto:user@domain.com"&gt;user@domain.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2012 11:41:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22014#M3334</guid>
      <dc:creator>hiteshkanchan</dc:creator>
      <dc:date>2012-05-30T11:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR Sending email with sendemail, but alert emails work fine</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22015#M3335</link>
      <description>&lt;P&gt;Same here as hiteshkanchan. Does not seem Splunk can actually send out emails from command.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 23:17:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22015#M3335</guid>
      <dc:creator>cli</dc:creator>
      <dc:date>2012-10-16T23:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR Sending email with sendemail, but alert emails work fine</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22016#M3336</link>
      <description>&lt;P&gt;If your email server enabled the ssl or tls, you need to use the following syntax.&lt;/P&gt;

&lt;P&gt;For tls enabled mail server:&lt;BR /&gt;
&lt;ANY search=""&gt;| sendemail from=&lt;EMAIL&gt; to=&lt;EMAIL&gt; server="&lt;MAIL server=""&gt;:&lt;PORT&gt;" use_tls=true username=&lt;YOUR mail="" user="" name=""&gt; password=&lt;YOUR mail="" password=""&gt; sendresults=true&lt;/YOUR&gt;&lt;/YOUR&gt;&lt;/PORT&gt;&lt;/MAIL&gt;&lt;/EMAIL&gt;&lt;/EMAIL&gt;&lt;/ANY&gt;&lt;/P&gt;

&lt;P&gt;For ssl enabled mail server:&lt;BR /&gt;
&lt;ANY search=""&gt;| sendemail from=&lt;EMAIL&gt; to=&lt;EMAIL&gt; server="&lt;MAIL server=""&gt;:&lt;PORT&gt;" use_ssl=true username=&lt;YOUR mail="" user="" name=""&gt; password=&lt;YOUR mail="" password=""&gt; sendresults=true&lt;/YOUR&gt;&lt;/YOUR&gt;&lt;/PORT&gt;&lt;/MAIL&gt;&lt;/EMAIL&gt;&lt;/EMAIL&gt;&lt;/ANY&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2012 09:40:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22016#M3336</guid>
      <dc:creator>daniel_splunk</dc:creator>
      <dc:date>2012-10-29T09:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR Sending email with sendemail, but alert emails work fine</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22017#M3337</link>
      <description>&lt;P&gt;This worked for me. Wasted over an hour on this!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2014 13:59:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22017#M3337</guid>
      <dc:creator>doconnorMHS</dc:creator>
      <dc:date>2014-04-11T13:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR Sending email with sendemail, but alert emails work fine</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22018#M3338</link>
      <description>&lt;P&gt;Adding the server= command worked for me also.  Wasn't aware that the command line would ignore the server wide email settings.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 21:05:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22018#M3338</guid>
      <dc:creator>etrailer</dc:creator>
      <dc:date>2016-01-07T21:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR Sending email with sendemail, but alert emails work fine</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22019#M3339</link>
      <description>&lt;P&gt;For some reason, sendemail.py doesn't use the same parameters as scheduled search. &lt;/P&gt;

&lt;P&gt;Setting the server parameters in the GUI (Settings-&amp;gt;Server Settings-&amp;gt;Email Settings) will get scheduled search to work, but not sendemail.&lt;/P&gt;

&lt;P&gt;Saved searches look in users/XXX/search/loca/savedsearches.conf, and then in ./system/local/alert_actions.conf&lt;/P&gt;

&lt;P&gt;sendemail from the command line doesn't. Or doesn't seem to. Maybe it does but the configured parameters are being overridden by empty strings from the command line?&lt;/P&gt;

&lt;P&gt;Either way, if you don't want to always be typing server=XXX on the command line, one option is to edit sendemail.py and hardcode your server config:&lt;/P&gt;

&lt;P&gt;For eg:&lt;/P&gt;

&lt;P&gt;Instead of:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;server     = ssContent.get('action.email.mailserver', 'localhost')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;server     = ssContent.get('action.email.mailserver', 'yourhost')
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Mar 2016 00:07:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22019#M3339</guid>
      <dc:creator>ben363</dc:creator>
      <dc:date>2016-03-21T00:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR Sending email with sendemail, but alert emails work fine</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22020#M3340</link>
      <description>&lt;P&gt;It is not working for me. Please help me brother.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 07:01:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22020#M3340</guid>
      <dc:creator>jitendra0101</dc:creator>
      <dc:date>2017-06-07T07:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR Sending email with sendemail, but alert emails work fine</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22021#M3341</link>
      <description>&lt;P&gt;I am getting the following error&lt;/P&gt;

&lt;P&gt;command="sendemail", 'rootCAPath' while sending mail to: *****&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 20:18:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ERROR-Sending-email-with-sendemail-but-alert-emails-work-fine/m-p/22021#M3341</guid>
      <dc:creator>kollachandra</dc:creator>
      <dc:date>2018-03-12T20:18:29Z</dc:date>
    </item>
  </channel>
</rss>

