用最简单方法解决api接口安全问题,几乎无法破解
docker运行gunicorn看不到控制台输出

利用qq邮箱作为个人邮件服务器发送邮件

妙音 posted @ 2019年4月06日 07:47 in python with tags 运维 , 6846 阅读
 需求描述
    邮件通知很有用处。如何搭建一个邮件服务器,允许发送邮件呢?
 

实现方法

 
一、利用开源软件,搭建自己的邮件服务器。
二、利用qq等第三方邮件服务。
 
自己搭邮件服务器较麻烦,我的需求比较简单,利用qq邮件,发送邮件即可,下面是方法.
 
 
 

设置方法

 
1.开启服务,获取授权码
邮箱设置-->帐户-->开启"IMAP/SMTP服务"
 
 
 
开启成功后,会给出一个授权码.
授权码就是发送邮件时的密码
 
2.python发送邮件
 
# -*- coding:utf-8 -*-
import smtplib
from email.mime.text import MIMEText
from email.header import Header

# 第三方 SMTP 服务
mail_host="smtp.qq.com"
mail_user="开启stmp服务器qq邮箱@qq.com"
mail_pass="授权码xxxx"   #口令/授权码


sender = 'sender@qq.com'
receivers = ['接收者@ikasinfo.com']

message = MIMEText('邮件发送测试...', 'plain', 'utf-8')
message['From'] = Header("测试", 'utf-8')
message['To'] =  Header("测试", 'utf-8')

subject = '邮件测试'
message['Subject'] = Header(subject, 'utf-8')

smtpObj = smtplib.SMTP_SSL()
smtpObj.connect(mail_host, 465)    # 465为SMTP加密端口号
smtpObj.login(mail_user,mail_pass)
smtpObj.sendmail(sender, receivers, message.as_string())
print("邮件发送成功")
 
此生必看的科学实验-水知道答案
《了凡四训》详解之改过之法
印光大师十念法(胡小林主讲第1集)
精神病为什么治不好
百病之源
 
 
Avatar_small
farhan 说:
2020年11月10日 00:48

Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also. 먹튀검증

Avatar_small
먹튀검증 说:
2020年11月14日 11:11

There's lots of dissertation internet websites via the internet at the time you get unsurprisingly discussed as part of your page.

Avatar_small
the avenir 说:
2020年11月16日 10:41

I recently found many useful information in your website especially this blog page. Among the lots of comments on your articles. Thanks for sharing.

Avatar_small
farhan 说:
2020年11月17日 14:43

Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. 먹튀검증커뮤니티

Avatar_small
Top SEO 说:
2020年11月24日 10:31

Really I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post. Hemp Bud

Avatar_small
Digital_Zone 说:
2020年11月30日 22:55

I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. Webdesign Limburg

Avatar_small
Digital_Zone 说:
2020年11月30日 23:44

Good website! I truly love how it is easy on my eyes it is. I am wondering how I might be notified whenever a new post has been made. I have subscribed to your RSS which may do the trick? Have a great day! Airco Oost-Vlaanderen

Avatar_small
Digital_Zone 说:
2020年11月30日 23:52

It is a good site post without fail. Not too many people would actually, the way you just did. I am impressed that there is so much information about this subject that has been uncovered and you’ve defeated yourself this time, with so much quality. Good Works! SEO webdesign

Avatar_small
Digital_Zone 说:
2020年12月01日 00:38

Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. Warmtepompen

Avatar_small
Digital_Zone 说:
2020年12月01日 00:42

You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. Airco Aalst

Avatar_small
Digital_Zone 说:
2020年12月01日 00:45

I visit your blog regularly and recommend it to all of those who wanted to enhance their knowledge with ease. The style of writing is excellent and also the content is top-notch. Thanks for that shrewdness you provide the readers! Airco Aalst

Avatar_small
Digital_Zone 说:
2020年12月01日 00:49

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. Webdesign Hasselt

Avatar_small
Digital_Zone 说:
2020年12月01日 00:53

It is truly a well-researched content and excellent wording. I got so engaged in this material that I couldn’t wait reading. I am impressed with your work and skill. Thanks. Installateur zonnepanelen

Avatar_small
Digital_Zone 说:
2020年12月01日 00:57

Interesting topic for a blog. I have been searching the Internet for fun and came upon your website. Fabulous post. Thanks a ton for sharing your knowledge! It is great to see that some people still put in an effort into managing their websites. I'll be sure to check back again real soon. SEO webdesigner

Avatar_small
Digital_Zone 说:
2020年12月01日 01:42

Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! Zonnepanelen Aalst

Avatar_small
Digital_Zone 说:
2020年12月01日 01:47

Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share. Koelinstallaties

Avatar_small
Digital_Zone 说:
2020年12月01日 01:51

Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return. Website laten maken prijs

Avatar_small
Digital_Zone 说:
2020年12月01日 01:55

I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... Zonnepanelen Herzele

Avatar_small
Digital_Zone 说:
2020年12月01日 01:59

You understand your projects stand out of the crowd. There is something unique about them. It seems to me all of them are brilliant. Koeltechniek

Avatar_small
Digital_Zone 说:
2020年12月01日 02:02

It is my first visit to your blog, and I am very impressed with the articles that you serve. Give adequate knowledge for me. Thank you for sharing useful material. I will be back for the more great post. Zonnepanelen installateur

Avatar_small
Digital_Zone 说:
2020年12月01日 02:06

I can’t imagine focusing long enough to research; much less write this kind of article. You’ve outdone yourself with this material. This is great content. Webdesign Alken

Avatar_small
Digital_Zone 说:
2020年12月01日 02:10

Thank you a bunch for sharing this with all of us you actually realize what you are talking about! Bookmarked. Please also seek advice from my site =). We could have a hyperlink change contract between us! Zonnepanelen Erpe-Mere

Avatar_small
Digital_Zone 说:
2020年12月01日 02:14

Wow, excellent post. I'd like to draft like this too - taking time and real hard work to make a great article. This post has encouraged me to write some posts that I am going to write soon. Vriescellen

Avatar_small
Digital_Zone 说:
2020年12月01日 02:18

Today, I was just browsing along and came upon your blog. Just wanted to say good blog and this article helped me a lot, due to which I have found exactly I was looking. Webdesign Kortessem

Avatar_small
Digital_Zone 说:
2020年12月01日 02:21

I think this is one of the most significant information for me. And i’m glad reading your article. But should remark on some general things, The web site style is perfect, the articles is really great : D. Good job, cheers Zonnepanelen

Avatar_small
Digital_Zone 说:
2020年12月01日 02:26

I know this is one of the most meaningful information for me. And I'm animated reading your article. But should remark on some general things, the website style is perfect; the articles are great. Thanks for the ton of tangible and attainable help. Koelsystemen

Avatar_small
Digital_Zone 说:
2020年12月01日 02:38

An interesting dialogue is price comment. I feel that it is best to write more on this matter, it may not be a taboo topic however usually individuals are not enough to talk on such topics. To the next. Cheers. Prijs webdesign Limburg

Avatar_small
Digital_Zone 说:
2020年12月01日 02:42

This article was written by a real thinking writer without a doubt. I agree many of the with the solid points made by the writer. I’ll be back day in and day for further new updates. Zonnepanelen Aalst

Avatar_small
Digital_Zone 说:
2020年12月01日 03:47

I’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website. Zonnepanelen prijs

Avatar_small
<a href="https://hea 说:
2020年12月15日 12:03

Hello! Quick question that’s completely off topic. Do you know how to make your site mobile friendly? My weblog looks weird when viewing from my iphone. I’m trying to find a template or plugin that might be able to resolve this problem. If you have any recommendations, please share. Many thanks! <a href="https://health2challenge.org">바카라사이트</a>

Avatar_small
<a href="https://hea 说:
2020年12月15日 12:04

Hello! Quick question that’s completely off topic. Do you know how to make your site mobile friendly? My weblog looks weird when viewing from my iphone. I’m trying to find a template or plugin that might be able to resolve this problem. If you have any recommendations, please share. Many thanks! [url=https://health2challenge.org]바카라사이트[/url]

Avatar_small
jacksonseo 说:
2020年12月15日 18:54

i never know the use of adobe shadow until i saw this post. thank you for this! this is very helpful. Online Jobs

Avatar_small
farhan 说:
2020年12月17日 01:51

I must admit that your post is really interesting. I have spent a lot of my spare time reading your content. Thank you a lot! best tv wall mount

Avatar_small
farhan 说:
2020年12月17日 13:44

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. Just saying thanks will not just be sufficient, for the fantasti c lucidity in your writing. I will instantly grab your rss feed to stay informed of any updates. buy youtube views real

Avatar_small
farhan 说:
2020年12月19日 00:13

Hello, this weekend is good for me, since this time i am reading this enormous informative article here at my home. fastest wifi router

Avatar_small
farhan 说:
2020年12月19日 21:01

The worst part of it was that the software only worked intermittently and the data was not accurate. You obviously canot confront anyone about what you have discovered if the information is not right. 토토

Avatar_small
Top SEO 说:
2020年12月20日 19:12

I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Features also. Keep working, great job ! download YouTube videos

Avatar_small
farhan 说:
2020年12月21日 00:17 New web site is looking good. Thanks for the great effort. KBC WhatsApp lottery 2021
Avatar_small
seoservise 说:
2020年12月21日 20:46

Wow, excellent post. I'd like to draft like this too - taking time and real hard work to make a great article. This post has encouraged me to write some posts that I am going to write soon. spring certification

Avatar_small
farhan 说:
2020年12月22日 12:40

I found that site very usefull and this survey is very cirious, I ' ve never seen a blog that demand a survey for this actions, very curious... mini sewing kit

Avatar_small
jacksonseo 说:
2020年12月22日 16:43

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. Schwimmbecken

Avatar_small
RWR 说:
2020年12月22日 17:25

Super site! I am Loving it!! Will return once more, Im taking your food additionally, Thanks. zahlungsabgleich shopify automatisch

Avatar_small
farhan 说:
2020年12月24日 02:24

The article posted was very informative and useful. You people are doing a great job. Keep going. best weed removal tool

Avatar_small
jacksonseo 说:
2020年12月24日 19:32

Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. mollie agenda

Avatar_small
Top SEO 说:
2020年12月25日 20:58

damesko høye hæler online - skobutikker på nett by www.highheels-no.com platåsko

Avatar_small
jacksonseo 说:
2020年12月25日 22:44

Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. fcra

Avatar_small
khan 说:
2020年12月26日 19:16

I have read some lines of your articles. Your writing skills are incredible. Please don't stop to share this type of standard content. I am also sharing a small piece of content that your audience may love here it is<a href="https://ew-studio.com//">먹튀검증사이트</a>

Avatar_small
seoservise 说:
2020年12月26日 22:05

Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also 论文代写

Avatar_small
jacksonseo 说:
2020年12月27日 14:14

I would like to say that this blog really convinced me to do it! Thanks, very good post. Iphone gebraucht

Avatar_small
jacksonseo 说:
2020年12月28日 14:47

Thanks For sharing this Superb article.I use this Article to show my assignment in college.it is useful For me Great Work. Poolleiter

Avatar_small
farhan 说:
2020年12月29日 14:00 I truly like you're composing style, incredible data, thankyou for posting. Poolleiter 
Avatar_small
farhan 说:
2021年1月01日 00:57 I am impressed. I don't think Ive met anyone who knows as much about this subject as you do. You are truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you have got here. poker online
Avatar_small
jacksonseo 说:
2021年1月03日 22:51

Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. www.otto.de

Avatar_small
seoservise 说:
2021年1月03日 23:20

Someone Sometimes with visits your blog regularly and recommended it in my experience to read as well. The way of writing is excellent and also the content is top-notch. Thanks for that insight you provide the readers! UBC代写

Avatar_small
jacksonseo 说:
2021年1月04日 16:52

Thanks for a wonderful share. Your article has proved your hard work and experience you have got in this field. Brilliant .i love it reading. buy aspadol 100 mg in usa with free shipping

Avatar_small
jacksonseo 说:
2021年1月05日 20:04

Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks voyance gratuite par telephone

Avatar_small
Top SEO 说:
2021年1月05日 21:13

First You got a great blog .I will be interested in more similar topics. i see you got really very useful topics, i will be always checking your blog thanks. buy Instagram followers

Avatar_small
jacksonseo 说:
2021年1月06日 19:50

You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. Holzpool

Avatar_small
Top SEO 说:
2021年1月08日 10:34

Great article Lot's of information to Read...Great Man Keep Posting and update to People..Thanks 토토사이트

Avatar_small
Top SEO 说:
2021年1月08日 23:53

You re in point of fact a just right webmaster. The website loading speed is amazing. It kind of feels that you're doing any distinctive trick. Moreover, The contents are masterpiece. you have done a fantastic activity on this subject! indian visa

Avatar_small
Top SEO 说:
2021年1月09日 13:01

Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. Best T-Shirt

Avatar_small
Top SEO 说:
2021年1月09日 19:15

You re in point of fact a just right webmaster. The website loading speed is amazing. It kind of feels that you're doing any distinctive trick. Moreover, The contents are masterpiece. you have done a fantastic activity on this subject! LATEST TECHNOLOGY UPDATES

Avatar_small
Imamia Quran Academy 说:
2023年8月07日 06:07

Hi everyone, I really love your story. You have very useful information; I am from Imamia Quran Academy. Shia Online Quran Academy is an institute for Quran Education. They have trained teaching staff along with renowned Islamic Scholars for a better understanding of the Quran. Join our Online Shia Quran Academy now, and Start your free 3 days Trial.

Avatar_small
Evan77 说:
2023年9月19日 00:03

I appreciate your presence here and your desire to contribute valuable and up-to-date content to my website. I believe it's important to continually improve and maintain a strong online presence for your own website as well.

<a href="https://acustomboxes.com/">A Custom Boxes</a>

Avatar_small
Chad 说:
2024年8月04日 15:58

Machen Sie Ihre Liebespuppe mit unserer Funktion „Nippel-/Areola-Farbe“ wirklich zu Ihrer eigenen. Wählen Sie aus einer Palette von Farben, sodass Sie jedes Detail individuell gestalten können. Ob Sie einen natürlichen oder auffälligen Look bevorzugen, unser Sortiment sorgt dafür, dass Ihre Puppe Ihren individuellen Geschmack widerspiegelt. Entdecken Sie die Freiheit der Anpassung für ein einzigartigeres und befriedigenderes Erlebnis. Aktualisieren Sie den Inhalt der Liebespuppen


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter