Example #1
0
				panic(err)
			}

			Eventually(func() int {
				return len(mailServer.Deliveries)
			}).Should(Equal(2))
			delivery = mailServer.Deliveries[1]

			Expect(delivery.Sender).To(Equal("*****@*****.**"))
			Expect(delivery.Recipient).To(Equal("*****@*****.**"))
			Expect(delivery.Data).To(Equal(strings.Split(secondMsg.Data(), "\n")))
		})

		Context("when configured to use TLS", func() {
			BeforeEach(func() {
				config.SkipVerifySSL = true
				client = mail.NewClient(config)
			})

			It("communicates over TLS", 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!",
						},
					},
				}