本文介绍了如何从命令行检查 smtp 是否正常工作(Linux)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 SMTP 服务器,出于这个问题的目的,我们称之为:smtp.mydomain.com.

I have a SMTP-server, for the purpose of this question lets call it: smtp.mydomain.com.

如何检查 SMTP 服务器是否在工作?我可以从 Linux 命令行手动发送电子邮件吗?

How do i check if the SMTP-server is in working? Can I send emails manually from Linux commandline?

推荐答案

使用 telnet 建立原始网络连接的语法是这样的:

Syntax for establishing a raw network connection using telnet is this:

telnet {domain_name} {port_number}

所以像 telnet 到你的 smtp 服务器一样

So telnet to your smtp server like

telnet smtp.mydomain.com 25

复制粘贴下面的内容

helo client.mydomain.com
mail from:<[email protected]>
rcpt to:<[email protected]>
data
From: [email protected]
Subject: test mail from command line

this is test number 1
sent from linux box
.
quit

注意:不要忘记."最后代表消息的结束.退出"行退出结束会话.

Note : Do not forgot the "." at the end which represents the end of the message.The "quit" line exits ends the session.

这篇关于如何从命令行检查 smtp 是否正常工作(Linux)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 17:34