{"id":27213343,"url":"https://github.com/anjibabuiitk/send-mail-from-terminal","last_synced_at":"2026-01-21T13:08:22.874Z","repository":{"id":189761288,"uuid":"108540333","full_name":"anjibabuIITK/Send-Mail-from-Terminal","owner":"anjibabuIITK","description":" Kapakayala Anji Babu , IIT Kanpur, India.","archived":false,"fork":false,"pushed_at":"2021-01-21T13:33:30.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-10T02:53:32.242Z","etag":null,"topics":["and","command-line","from","gmail","mutt","sendmail","using"],"latest_commit_sha":null,"homepage":"https://anjibabuiitk.github.io/Send-Mail-from-Terminal/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anjibabuIITK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-10-27T11:55:34.000Z","updated_at":"2021-01-21T13:33:32.000Z","dependencies_parsed_at":"2023-08-21T17:25:37.465Z","dependency_job_id":null,"html_url":"https://github.com/anjibabuIITK/Send-Mail-from-Terminal","commit_stats":null,"previous_names":["anjibabuiitk/send-mail-from-terminal"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anjibabuIITK/Send-Mail-from-Terminal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjibabuIITK%2FSend-Mail-from-Terminal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjibabuIITK%2FSend-Mail-from-Terminal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjibabuIITK%2FSend-Mail-from-Terminal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjibabuIITK%2FSend-Mail-from-Terminal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anjibabuIITK","download_url":"https://codeload.github.com/anjibabuIITK/Send-Mail-from-Terminal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anjibabuIITK%2FSend-Mail-from-Terminal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28633748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["and","command-line","from","gmail","mutt","sendmail","using"],"created_at":"2025-04-10T02:40:26.380Z","updated_at":"2026-01-21T13:08:22.848Z","avatar_url":"https://github.com/anjibabuIITK.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Send Mail From Terminal  using gmail and Mutt.**\n   \n  - We can send mails from our terminals from gmail by using mutt package. \n\n  - It really cool idea to write scipts for login alerts  or some notifications from your PC or\n    servers for monitering its performance.\n\n  - In such cases ,mutt is very nice package to send mails from command line or scripts in easy way.\n  \n  - Let see how to Install and Configure Mutt package in our PC\n\n# **Install Mutt Package**\n\n**CentOs   :** \n                 \n       yum install mutt  \n       \n**Ubuntu   :**  \n\n       sudo apt-get install mutt\n\n# **Configure Mutt**\n\n- Create these folders\n\n                  mkdir -p /.mutt/cache\n                  \n- Create **Mutt** Configuration file **~/.muttrc** and add below lines and change your gmail and password \n\n                set from = \"user@gmail.com\"\n                set realname = \"ANY NAME\"\n                set imap_user = \"username@gmail.com\"\n                set imap_pass = \"gmail-password\"\n                set folder = \"imaps://imap.gmail.com:993\"\n                set spoolfile = \"+INBOX\"\n                set postponed =\"+[Gmail]/Drafts\"\n                set header_cache =~/.mutt/cache/headers\n                set message_cachedir =~/.mutt/cache/bodies\n                set certificate_file =~/.mutt/certificates\n                set smtp_url = \"smtp://user@smtp.gmail.com:587/\"\n                set smtp_pass = \"gmail-password\"\n                set move = no \n                set imap_keepalive = 900\n  \n# **Gmail Setup :**\n\n- **IMAP setup :**\n\nIn your gmail, click the gear icon on right corner, open Settings ,Then click on Forwarding POP/IMAP on top , and enable IMAP Aceess . Click on configuration instructions to know more about IMAP access settings.\n\n- **SSL setup:**\n\nInorder to access your gmail from mutt, you need to provide the access rights to mutt to use smtp server. turn ON the access to the less secure app\nfrom the Google account. following link can be referenced.\n\n      https://support.google.com/accounts/answer/6010255?p=lsa_blocked\u0026hl=en\u0026visit_id=637468299219858485-1060437365\u0026rd=1\n\n# **Sending Mails :**\n  \n  - Sends mail with subject, messege body from given file ( msgbody.txt )\n               \n        mutt -s \"Subject here\" username@gmail.com \u003c msgbody.txt\n  \n  - Sends mail with given subject, msg body and attachment.\n  \n        mutt -s \"subject Here\" username@gmail.com \u003c msgbody.txt  -a  attachment.pdf\n   \n  - This command also does same as above but otherway.\n               \n         echo \"Messege Here\" | mutt -s \"Subject here\" username@gmail.com -a attachment.pdf\n   \n# **Reference :**\n   \n   - Its highly recomended to visit mutt documentation for more details.\n   \n               http://www.mutt.org/#doc\n             \n             \n# **Shell Script to Send Mails from Terminal**             \n             \n ```shell\n \n# Bash Script to send mails from terminal by using mutt package.\n#\n# Authour :  ANJI BABU KAPAKAYALA\n#             IIT KANPUR, INDIA.\n# USAGE   : sh send_mail.sh (Then follow instructionns)\n#\n#!/bin/bash\necho \"==================================================\"\necho -e \"\\e[31;44m*****WELCOME TO ANJI BABU MAILING SERVICE *****\\e[0m\"\necho \"===================================================\"\nyes=\"y\"\nno=\"n\"\necho \"\"\nread -p \"Enter mail-id:\" mailid          #Enter mailid of reciver\nread -p \"Enter Subject :\" subject        #Enter Subject of mail\n# if [[ $subject == *\"$no\"* ]] then\n#    echo \"You choosed not to enter subject\"\n# fi\nread -p \"Write Message here  :\" msg      # Write body of message here\n# if [[ $msg == *\"$no\"* ]] \n# then\n#    echo \"You have choosed not to enter Message\"\n# fi\nread -p \"Any Attachments ( y/n) :\" choice   #Enter y if you want to attach file else enter n\n if [[ $choice == *\"$yes\"* ]] \n then\n    read -p \"Enter attachment :\" filename   #Enter filename of attachment\n    echo \"\"\n    echo \"sending mail to $mailid\"\n    echo \"$msg\" |mutt -s \"$subject\" $mailid -a $filename   \n else\n    echo \"\"\n    echo \"No file is attached\" \n    echo \"sending mail to $mailid\"\n    echo \"$msg\" |mutt -s \"$subject\" $mailid   \n fi\necho \"\"\necho \"Your mail has been sent.\"\necho \"\"\necho \"====================================================\" \n ```\n ```\n \n       # =========================================================================#\n       #                        ANJI BABU KAPAKAYALA                              #\n       #                         IIT KANPUR, INDIA.                               #\n       #==========================================================================#\n ```\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanjibabuiitk%2Fsend-mail-from-terminal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanjibabuiitk%2Fsend-mail-from-terminal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanjibabuiitk%2Fsend-mail-from-terminal/lists"}