質問編集履歴
2
エラー部分の不要情報削除
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<ipython-input-17-09ff481f31ec> in main()
|
|
24
24
|
32 subject = SUBJECT
|
|
25
25
|
33 #htmlファイルを読み込み。メール本文に挿入
|
|
26
|
-
---> 34 test_data = open(r'C:\Users\
|
|
26
|
+
---> 34 test_data = open(r'C:\Users\Desktop\work\情報.html', "r",'utf-8', 'ignore')
|
|
27
27
|
35 contents = test_data.read()
|
|
28
28
|
36 body = contents
|
|
29
29
|
|
1
コードブロック使用なし➡ありに変更。リンク部分のリンクなし➡ありに変更
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
### pandas から読み込んだ内容をHTMLに落としてそれをgmailの本文に記載したいです。
|
|
2
2
|
※依頼者からのオーダーでメール本文に内容を記載したいです
|
|
3
3
|
|
|
4
|
-
こちらのサイトを参考にしてやってみましたがエラーが出てしまいます。➡http://wheelchairtext.net/program/1487/
|
|
4
|
+
こちらのサイトを参考にしてやってみましたがエラーが出てしまいます。➡[リンク内容](http://wheelchairtext.net/program/1487/)
|
|
5
5
|
|
|
6
|
-
出ているエラーはこちらです➡TypeError: an integer is required (got type str)
|
|
7
|
-
|
|
8
6
|
HTMLの内容は以下の感じです
|
|
9
7
|
|
|
10
8
|
カラムA(店名) カラムB(所在地)
|
|
@@ -14,8 +12,29 @@
|
|
|
14
12
|
4 ●●店 ●●県●●市
|
|
15
13
|
5 ●●店 ●●県●●市
|
|
16
14
|
|
|
15
|
+
### 出ているエラーはこちらです
|
|
16
|
+
```ここに言語を入力
|
|
17
|
+
TypeError Traceback (most recent call last)
|
|
18
|
+
<ipython-input-17-09ff481f31ec> in <module>
|
|
19
|
+
40
|
|
20
|
+
41 if __name__ == '__main__':
|
|
21
|
+
---> 42 main()
|
|
22
|
+
|
|
23
|
+
<ipython-input-17-09ff481f31ec> in main()
|
|
24
|
+
32 subject = SUBJECT
|
|
25
|
+
33 #htmlファイルを読み込み。メール本文に挿入
|
|
26
|
+
---> 34 test_data = open(r'C:\Users\furug\Desktop\work\ホール情報.html', "r",'utf-8', 'ignore')
|
|
27
|
+
35 contents = test_data.read()
|
|
28
|
+
36 body = contents
|
|
29
|
+
|
|
30
|
+
TypeError: an integer is required (got type str)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
17
35
|
### 現在のコードは以下です
|
|
18
36
|
|
|
37
|
+
```ここに言語を入力
|
|
19
38
|
import smtplib
|
|
20
39
|
import email.message
|
|
21
40
|
|
|
@@ -57,4 +76,5 @@
|
|
|
57
76
|
send(FROM_ADDRESS, to_addr, msg)
|
|
58
77
|
|
|
59
78
|
if __name__ == '__main__':
|
|
60
|
-
main()
|
|
79
|
+
main()
|
|
80
|
+
```
|