Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux basic command-sendmail sends mail

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Sendmail

Sendmail is a mail sending agent in postfix, which is responsible for sending mail to a remote server and can receive mail. When sendmail sends an email, it defaults to reading from the tile input to "." To the end.

The scope of application of this command: RedHat, RHEL, Ubuntu, CentOS, Fedora.

1. Grammar

Sendmail [option...] [recipient...]

2. List of option parameters

Option

Description

-bd

Enter deamon mode

-bi

Initialize the alias database

-bm

Read messages from standard input

-bp

List mailing list

-bs

Independent smtp mode, read from standard input, output to standard output

-C

Location of main.cf

-F

Specify the full name of the sender

-f

Specify the sender

-I

Ignore lines with only a single point

-Q

Process messages in the queue at a given interval

3. Examples

1) send an email to SB.

[root@localhost ~] # sendmail david / / send email to david. The default sender is root.

one hundred and twenty three。

.

[root@localhost ~] # tail / var/spool/mail/david / / check david mailbox and receive email

Delivered-To: david@david.cn

Received: by mailsrv.david.cn (Postfix, from userid 0)

Id 5B3A7143211; Fri, 5 Oct 2018 21:33:34 + 0800 (CST)

Message-Id:

Date: Fri, 5 Oct 2018 21:33:29 + 0800 (CST)

From: root@david.cn (wejie)

To: undisclosed-recipients:

one hundred and twenty three。

2) specify the sender

[root@localhost ~] # sendmail-f weijie david / / weijie send email to david

Hehe

.

You have new mail in / var/spool/mail/root

[root@localhost ~] # tail / var/spool/mail/david / / check david email. The sender is Wei Jie.

Delivered-To: david@david.cn

Received: by mailsrv.david.cn (Postfix, from userid 0)

Id 3544314308F; Fri, 5 Oct 2018 21:37:11 + 0800 (CST)

Message-Id:

Date: Fri, 5 Oct 2018 21:37:07 + 0800 (CST)

From: weijie@david.cn (wejie)

To: undisclosed-recipients:

Hehe

3) check what fields are in the table

[root@localhost ~] # mysqlshow-u root-p test wj / / displays information about table wj in database test

Enter password:

Database: test Table: wj

+-+

| | Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |

+-+

| | id | int (11) | | NO | select,insert,update,references | | |

| | name | text | latin1_swedish_ci | NO | select,insert,update,references | | |

+-+

A Linux learning platform has been made, and a prototype has come out at present, which you can refer to and use.

Link: https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ password: n7bk

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report