Windows Task Scheduler fails at sending e-mail

6,593

What the hell, I am now using blat to send mails (Action -> Start Program -> blat). Forget the M$ built-in and non-working crap.

(Sorry for the frustration, but taking two days trying to send a plain mail without anyone anywhere having a clue how to make it work doesn't make me happy at all.)

Share:
6,593

Related videos on Youtube

Kishan K
Author by

Kishan K

Server and network admin since I was in high school. That was a long time ago. Experience with several Linux distros, initially LAMP, currently all kinds of applications. My experience includes not only front-end (OS, switching, routing and firewalling), but also the backend like virtualization (VMware), storage, SAN and backup. Monitoring with Nagios and Icinga. Recent admirer of the ELK stack. I like the challenge and the diversification of spending time at any of those layers whenever necessary. Don't tell me to go sit in a corner and manage a DNS server for the rest of my life. Experience with mail services, issue trackers like Jira and OTRS, tools like MediaWiki, etc. etc. Also had to endure Windows application packaging using some obscure tools. Performed helpdesk tasks as a student. Love cats.

Updated on September 18, 2022

Comments

  • Kishan K
    Kishan K over 1 year

    The error is 2147746321.

    I can see in the mailserver log that it tries, but the connection gets closed.

    Wed 2012-10-10 15:55:25: Session 990590; child 1
    Wed 2012-10-10 15:55:25: Accepting SMTP connection from [x:49161] to [y:25]
    Wed 2012-10-10 15:55:25: --> 220 Mdaemon; Wed, 10 Oct 2012 15:55:25 +0200
    Wed 2012-10-10 15:55:25: <-- EHLO x
    Wed 2012-10-10 15:55:25: --> 250-Hello x, pleased to meet you
    Wed 2012-10-10 15:55:25: --> 250-VRFY
    Wed 2012-10-10 15:55:25: --> 250-EXPN
    Wed 2012-10-10 15:55:25: --> 250-ETRN
    Wed 2012-10-10 15:55:25: --> 250-AUTH LOGIN
    Wed 2012-10-10 15:55:25: --> 250-8BITMIME
    Wed 2012-10-10 15:55:25: --> 250 SIZE 20971000
    Wed 2012-10-10 15:55:25: <-- AUTH LOGIN
    Wed 2012-10-10 15:55:25: --> 334 VX......
    Wed 2012-10-10 15:55:25: Connection closed
    Wed 2012-10-10 15:55:25: SMTP session terminated (Bytes in/out: 26/212)
    

    Googling does not reveal much except that it indeed "doesn't work" and Exchange pops up all over the place.

    This is no Exchange server. I just want a plain and straight SMTP connection to work. How?

    (I have tried running the task as normal user and as system account, no difference.)

    Sending a mail manually using telnet to port 25 from that server is working.

    (Windows 2008 R2)

    • John Gardeniers
      John Gardeniers over 11 years
      What version of Windows? How are you trying to send the message? After all, it's not the Task Scheduler that's trying to send the message but whatever script or program it's running. Relevant details are required.
    • Kishan K
      Kishan K over 11 years
      Sure, Task Scheduler sends the message. The action defined in task scheduler is to send an e-mail. I don't care how it does. It should just do it.
    • Kishan K
      Kishan K over 11 years
      Sending a mail manually using telnet to port 25 from that server is working.
  • Kishan K
    Kishan K over 11 years
    The user running the task seems to have enough rights opening a socket to the mailserver. For the rest, it exchanges plain SMTP commands and data, which should be accepted by the mailserver. At least it is accepted when trying a manual send via port 25.
  • Jerrish Varghese
    Jerrish Varghese over 11 years
    In your attempt to send manually, are you providing authentication? Just saying that you can send mail via telnet doesn't answer my questions above to allow us to continue troubleshooting.
  • Jerrish Varghese
    Jerrish Varghese over 11 years
    The statement about anyone anywhere having a clue is not true. We just began to troubleshoot and there is nowhere near enough detail to make an actual call if the Task Scheduler mail is broken. I can understand being frustrated trying to make things work, but if you ask a question in a public forum, you need to understand that we don't know anything about your environment other than what you tell us in the question. People leaving answers or comments are just trying to find the relevant details to help you. Answers like this make people much less willing to help.
  • Kishan K
    Kishan K over 11 years
    Sorry, but the net is full of people failing to send mail using Task Scheduler. Probably by "sending e-mail" they (Microsoft) understand something else than a plain old SMTP connection without gimmicks.
  • Alan M
    Alan M almost 8 years
    The net is full of people failing to get W2K8R2 Scheduled Tasks to run at all. I am expecting this to be fixed with a service pack, or the classic "oh, that never worked correctly in (pevious version). You need (current version)."