You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
format!("To: <{}>\r\nFrom: <sender@localhost>\r\nMessage-ID: <{}.msg@localhost>\r\nSubject: My first e-mail\r\n\r\nHello world from SMTP", to, message_id),
128
+
)
129
+
}
133
130
134
131
#[test]
135
132
#[ignore]
@@ -142,16 +139,11 @@ fn inbox() {
142
139
c.select("INBOX").await.unwrap();
143
140
144
141
println!("sending");
142
+
letmut s = smtp(to).await;
143
+
145
144
// then send the e-mail
146
-
letmut s = smtp(to);
147
-
let e = lettre_email::Email::builder()
148
-
.from("sender@localhost")
149
-
.to(to)
150
-
.subject("My first e-mail")
151
-
.text("Hello world from SMTP")
152
-
.build()
153
-
.unwrap();
154
-
s.send(e.into()).unwrap();
145
+
let mail = make_email(to);
146
+
s.connect_and_send(mail).await.unwrap();
155
147
156
148
println!("searching");
157
149
@@ -191,7 +183,7 @@ fn inbox() {
191
183
let fetch = &fetch[0];
192
184
assert_eq!(fetch.message,1);
193
185
assert_ne!(fetch.uid,None);
194
-
assert_eq!(fetch.size,Some(138));
186
+
assert_eq!(fetch.size,Some(21));
195
187
let e = fetch.envelope().unwrap();
196
188
assert_eq!(e.subject,Some(&b"My first e-mail"[..]));
0 commit comments