Hey Julia, 

I ended up doing a lot of things in order for it to work and I don't know which ones are totally necessary. My issue is specific to Debian/Gmail/Mutt so this won't apply to everyone. But I have a feeling that the HELO/ELHO error occurred because I did not have a domain configured. I had:

$ hostname 
localhost 
$ domainname 
(none)

so I ended up changing my /etc/hosts and /etc/hostname file. 

My /etc/hostname just says hostname1

My /etc/hosts has 2 lines that say:

127.0.0.1 localhost
127.0.1.1 hostname1.localdomain hostname1

Then run 

$ sudo /etc/init.d/hostname.sh start 
$ sudo reboot

verify changes with 
$ hostname
hostname1
$ hostname -d 
localdomain

I think that suffices for a "FQDN" Fully Qualified Domain Name. 

$ sudo apt-get update
$ sudo apt-get install exim4

After that I followed this tutorial exactly: https://wiki.debian.org/GmailAndExim4

It explains exactly what to put for each menu entry when you run 
$ sudo dpkg-reconfigure exim4-config

After that, mutt will send emails! 

Since this is such a specific case, maybe it can go on some FAQ or Troubleshooting page??
 
Sincerely,
Liz

On Thursday, September 22, 2016 at 1:33:11 PM UTC-7, Julia Lawall wrote:


On Thu, 22 Sep 2016, gnud...@gmail.com wrote:

> Hey Vaishali, 
> Thanks for your reply. I finally figured it out. Hallelujah.
> The Debian installation manual specifically says to use exim4 in order to
> set up debian to use e-mail:
> https://www.debian.org/releases/jessie/i386/ch08s05.html.en
>
> I had to closely follow this tutorial in order to finally get it to work:
> https://wiki.debian.org/GmailAndExim4
>
> I also had to fix my /etc/hosts and /etc/hostname file. 
>
> I thought I'd post these in case you're using Debian. 

Do you want me to add anything to the tutorial?

julia


>
> On Wednesday, September 21, 2016 at 9:47:33 PM UTC-7, Vaishali Thakkar
> wrote:
>       On Thu, Sep 22, 2016 at 1:18 AM,  <gnud...@gmail.com> wrote:
>       > Hi everyone,
>       >
>       > Thanks for your replies. I've tried many .muttrc config
>       changes and Gmail
>       > setup but I keep getting the same error.
>       > I think I'm supposed to set up a FQDN (Fully Qualified Domain
>       Name). Mutt
>       > keeps telling me there is no HELO/ELHO argument
>
>       I am not sure about this error but usually Mutt fails for me if
>       I use
>       it under firewall,
>       proxy settings or vpn. So, I don't use it anymore. Git
>       send-email
>       works good for me.
>       If you can't figure out the solution of this error and want to
>       go for
>       the git send-email
>       then you can check this blog:
>
> https://burzalodowa.wordpress.com/2013/10/05/how-to-send-patches-with-git-s
>       end-email/
>
>       It just requires to set up .gitconfig. I can share my settings
>       but I
>       think that blog explains
>       almost everything in detail.
>
>       > On Tuesday, September 20, 2016 at 11:01:18 PM UTC-7,
>       gnud...@gmail.com
>       > wrote:
>       >>
>       >> Hello everyone,
>       >>
>       >> I'm on Debian Jessie and I cannot get mutt to send email. I
>       can receive
>       >> emails and view my inbox in Mutt but I can't send messages. I
>       can send them
>       >> to myself though. I can't send them to another email address.
>       >>
>       >> When I use mutt to send an email I keep getting this
>       HELO/ELHO error:
>       >>
>       >> SMTP session failed: 501 5.5.4
>        https://support.google.com/mail/?p=helo
>       >> yg10sm21072351pab.8 - gsmtp
>       >>
>       >> That brings me to this page:
>       >>
>       >>https://support.google.com/mail/answer/6386757?visit_id=1-63610024331271608
>       0-1894628512&p=helo&rd=1
>       >>
>       >> I can't figure out how to resolve this issue. My 2 factor is
>       off and I'm
>       >> allowing login from unsecure apps. I'm also trying to use
>       ssmtp instead of
>       >> esmtp but the same thing happens in mutt.
>       >>
>       >> When i do
>       >> $ sudo ssmtp some...@gmail.com
>       >>
>       >> the email does actually go through though, but it says from
>       root.
>       >>
>       >> If anyone has suggestions I would really appreciate it!
>       >> Thanks,
>       >> Liz
>       >
>       > --
>       > You received this message because you are subscribed to the
>       Google Groups
>       > "outreachy-kernel" group.
>       > To unsubscribe from this group and stop receiving emails from
>       it, send an
>       > email to outreachy-kern...@googlegroups.com.
>       > To post to this group, send email to
>       outreach...@googlegroups.com.
>       > To view this discussion on the web visit
>       >https://groups.google.com/d/msgid/outreachy-kernel/649173d5-38d8-43e3-af3b-
>       a81aab81311d%40googlegroups.com.
>       >
>       > For more options, visit https://groups.google.com/d/optout.
>
>
>
>       --
>       Vaishali
>       http://vaishalithakkar.in/
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kern...@googlegroups.com.
> To post to this group, send email to outreach...@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/c33bb083-d19f-473c-9f16-
> 92bbd62d4e80%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>