Coder Social home page Coder Social logo

hitsz-maillab-2023's Introduction

maillab

指导书留档:https://github.com/xuanhao44/comp-network-2023

实现一个简单的邮件客户端,完成邮件发送与接收功能:

  • 使用 STMP 协议与邮件服务器交互,将邮件发送给任意收件人。
  • 使用 POP3 协议与服务器交互,查询收件箱中的邮件信息。

Send your emails

  1. send.c 文件中更改 host_nameuserpassfrom 为邮件服务器名称(如 smtp.qq.com)、你的邮箱(如 [email protected])、你的授权码(请自行在邮箱设置中获取)和发件人邮箱。

  2. 编译程序:

    make
  3. 在终端中执行以下命令:

    ./send RECIPIENT [-s SUBJECT] [-m MESSAGE] [-a ATTACHMENT]

    其中各参数为:

    • RECIPIENT:收件人邮箱

    • SUBJECT:邮件主题

    • MESSAGE:邮件正文 或 含有邮件正文的文件路径

      程序会首先检查 MESSAGE 是否是文件路径,如果是则读取文件内容作为正文,否则直接将其作为正文

    • ATTACHMENT:邮件附件,只支持一个附件

Receive your emails

邮件收取功能相对固定,将按顺序执行以下操作:查看邮件总数和总大小,列出所有邮件和它们的大小,展示第一封邮件的内容。

  1. recv.c 文件中更改 host_nameuserpass 为邮件服务器名称(如 pop.qq.com)、你的邮箱(如 [email protected])、你的授权码(请自行在邮箱设置中获取)。

  2. 编译程序:

    make
  3. 在终端中执行以下命令:

    ./recv

可能要注意的点

关于使用 encode 之后是否需要加上 "\r\n",每个同学都有差异,有的人说要加,有的人说不要加。很奇怪,所以还是要自己试试行不行。

hitsz-maillab-2023's People

Contributors

qiu601 avatar xuanhao44 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.