Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: using MSMTP from the command line  (Read 23995 times)

0 Members and 1 Guest are viewing this topic.

OutThere

    Topic Starter


    Greenhorn

    using MSMTP from the command line
    « on: August 20, 2008, 01:30:01 PM »
    I need to send an email from the command line/batch script. I am currently using MSMTP for this. I'd be willing to change BUT the program MUST be able to send using a Gmail account.

    I've got MSMTP configured and use the following to send a message:
    echo Subject: Hi | msmtp [email protected]
    or:
    msmtp [email protected] < C:\message
    where C:\message contains:
    Subject: Hi

    I have tried just about EVERYTHING to get a body in the message, trying Body:, Text:, and Message:, placing these under or after the Subject: (Subject: works fine by the way)

    any ideas?

    fireballs



      Apprentice

    • Code:Terminal
    • Thanked: 3
      Re: using MSMTP from the command line
      « Reply #1 on: August 20, 2008, 02:15:41 PM »
      presumably you've read through the documentation for MSMTP? http://msmtp.sourceforge.net/doc/msmtp.html and tried
      Code: [Select]
      --help

      FB
      Next time google it.

      OutThere

        Topic Starter


        Greenhorn

        Re: using MSMTP from the command line
        « Reply #2 on: August 20, 2008, 02:33:41 PM »
        yes. MSMTP appears to be designed as a replacement for the program that sends your email normally, i.e., it is designed to be used with annother program, like Mutt. And the documentation contains NO information on using MSMTP, just configuring it! Gack!

        fireballs



          Apprentice

        • Code:Terminal
        • Thanked: 3
          Re: using MSMTP from the command line
          « Reply #3 on: August 20, 2008, 02:52:43 PM »
          I'm confused do you still need us?

          FB
          Next time google it.

          OutThere

            Topic Starter


            Greenhorn

            Re: using MSMTP from the command line
            « Reply #4 on: August 20, 2008, 02:57:21 PM »
            err, yes, I read the docs before posting. they provide NO information on using the app, only on configuring it. I need to know how to use MSMTP from the command line or a batch script. I can get it to send and email with a subject but not with a body. If there is another command line app that can send though a Gmail account, I'll switch to it if it is better.

            fireballs



              Apprentice

            • Code:Terminal
            • Thanked: 3
              Re: using MSMTP from the command line
              « Reply #5 on: August 20, 2008, 05:02:28 PM »
              Then sorry i don't think i can help you, though i'm not sure DOS is the best place to look for support... try over in software.

              FB
              Next time google it.

              mser

              • Guest
              Re: using MSMTP from the command line
              « Reply #6 on: September 29, 2008, 01:08:38 PM »
              spent a few days on this one.  stick a blank line in your file between subject and the message body.

              Subject: my subject

              body starts here
              line 2
              end of body

              huwenhuo



                Newbie

                Re: using MSMTP from the command line
                « Reply #7 on: May 07, 2009, 09:11:29 AM »
                yes, it is very useful to send mails as commandline form. and it works as a blank between the subject and other contents. but there still a problem, i cannot found a way to attach additional files when using msmtp.

                Dias de verano

                • Guest
                Re: using MSMTP from the command line
                « Reply #8 on: May 07, 2009, 11:54:18 AM »
                i cannot found a way to attach additional files when using msmtp.

                Can be done by encoding with base64


                huwenhuo



                  Newbie

                  Re: using MSMTP from the command line
                  « Reply #9 on: May 07, 2009, 06:08:26 PM »
                  i finally found a better way to send mail at command line

                  ehco 'mail content' | mutt -s 'subject' -a additionalFileName [email protected]


                  uSlackr



                    Rookie

                  • A turtle on the information highway since 1989
                  • Thanked: 2
                    Re: using MSMTP from the command line
                    « Reply #10 on: May 09, 2009, 03:55:09 PM »
                    FWIW, I've used blat for years to send mail from a script.  It works great

                    Development seems to have slowed, but it is very mature

                    http://www.blat.net/


                    \\uSlackr
                    \\uSlackr