I want to send mail through "telnet smtp.gmail.com 25" but an error is prompted when sending a message "530 5.7.0 Must issue a STARTTLS command first".

I am working on Ubuntu Linux Server. I googled out, and installed ssmtp and tried to add a few lines in ssmtp.conf file so that I could send mail through telnet.


But, since the file is read only and also I am not able to change the user rights, Permission Denied. Since I am the administrator of my own system, how can I edit the file and add few lines of code in it?

Also, please tell me whether these techniques will work for me, or any other useful technique available where I can send mails by telnetting.


  • Is this related to system administration in some way? – John Gardeniers Sep 21 '09 at 3:36

On Ubuntu you need to use sudo when modifying the files. The account you use isn't running with administrator privileges.

  • How can i do that.. Some steps would be useful. Thanks.. – RBA Sep 19 '09 at 16:47
  • 1
    @RBA: you would do something like this 'sudo nano ssmtp.conf' it would then prompt you for YOUR password. That will escalate your privileges and allow you to edit your conf file. – Zypher Sep 19 '09 at 16:50

You can't send or receive mail from gmail's servers without a valid SSL certificate. This guide explains the steps involved.

  • Ok,, Is there any other Server,, which can allow me to send mail through smtp telnetting.. Thanks. – RBA Sep 20 '09 at 6:33
  • 1
    Try using your ISP's mail server. – Zanchey Sep 20 '09 at 13:24

Outside of an SMTP server you personally own and administer, you shouldn't be telnetting to port 25 to send mail - it looks spammy.

I'm presuming that you're just trying to figure out how SMTP works, or perhaps implementing a mail client - but you should try this against your own server, and not one somebody else runs :)


If you wish to send email through gmail servers, you need to use secure SMTP, which does not sit on port 25. According to the google help page, you need to connect to either port 465 of 587 for secure SMTP over SSL/TLS. If you want to test it out using telnet, either use telnet-ssl or openssl client to test the connections.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.