示例#1
0
					panic(err)
				}

				Eventually(func() int {
					return len(mailServer.Deliveries)
				}).Should(Equal(1))

				delivery := mailServer.Deliveries[0]
				Expect(delivery.UsedTLS).To(BeTrue())
			})
		})

		Context("when configured to not use TLS", func() {
			BeforeEach(func() {
				mailServer.SupportsTLS = false
				config.DisableTLS = true
				client = mail.NewClient(config)
			})

			It("does not authenticate", func() {
				msg := mail.Message{
					From:    "*****@*****.**",
					To:      "*****@*****.**",
					Subject: "Urgent! Read now!",
					Body: []mail.Part{
						{
							ContentType: "text/plain",
							Content:     "This email is the most important thing you will read all day!",
						},
					},
				}