@@ -251,70 +251,70 @@ public function testGenerateBody()
251
251
$ att = new DataPart ($ file = fopen (__DIR__ .'/Fixtures/mimetypes/test ' , 'r ' ));
252
252
$ img = new DataPart ($ image = fopen (__DIR__ .'/Fixtures/mimetypes/test.gif ' , 'r ' ), 'test.gif ' );
253
253
254
- $ e = (new Email ())->from ('me@example.com ' );
254
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
255
255
$ e ->text ('text content ' );
256
256
$ this ->assertEquals ($ text , $ e ->getBody ());
257
257
$ this ->assertEquals ('text content ' , $ e ->getTextBody ());
258
258
259
- $ e = (new Email ())->from ('me@example.com ' );
259
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
260
260
$ e ->html ('html content ' );
261
261
$ this ->assertEquals ($ html , $ e ->getBody ());
262
262
$ this ->assertEquals ('html content ' , $ e ->getHtmlBody ());
263
263
264
- $ e = (new Email ())->from ('me@example.com ' );
264
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
265
265
$ e ->html ('html content ' );
266
266
$ e ->text ('text content ' );
267
267
$ this ->assertEquals (new AlternativePart ($ text , $ html ), $ e ->getBody ());
268
268
269
- $ e = (new Email ())->from ('me@example.com ' );
269
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
270
270
$ e ->html ('html content ' , 'iso-8859-1 ' );
271
271
$ e ->text ('text content ' , 'iso-8859-1 ' );
272
272
$ this ->assertEquals ('iso-8859-1 ' , $ e ->getTextCharset ());
273
273
$ this ->assertEquals ('iso-8859-1 ' , $ e ->getHtmlCharset ());
274
274
$ this ->assertEquals (new AlternativePart (new TextPart ('text content ' , 'iso-8859-1 ' ), new TextPart ('html content ' , 'iso-8859-1 ' , 'html ' )), $ e ->getBody ());
275
275
276
- $ e = (new Email ())->from ('me@example.com ' );
276
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
277
277
$ e ->attach ($ file );
278
278
$ e ->text ('text content ' );
279
279
$ this ->assertEquals (new MixedPart ($ text , $ att ), $ e ->getBody ());
280
280
281
- $ e = (new Email ())->from ('me@example.com ' );
281
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
282
282
$ e ->attach ($ file );
283
283
$ e ->html ('html content ' );
284
284
$ this ->assertEquals (new MixedPart ($ html , $ att ), $ e ->getBody ());
285
285
286
- $ e = (new Email ())->from ('me@example.com ' );
286
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
287
287
$ e ->attach ($ file );
288
288
$ this ->assertEquals (new MixedPart ($ att ), $ e ->getBody ());
289
289
290
- $ e = (new Email ())->from ('me@example.com ' );
290
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
291
291
$ e ->html ('html content ' );
292
292
$ e ->text ('text content ' );
293
293
$ e ->attach ($ file );
294
294
$ this ->assertEquals (new MixedPart (new AlternativePart ($ text , $ html ), $ att ), $ e ->getBody ());
295
295
296
- $ e = (new Email ())->from ('me@example.com ' );
296
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
297
297
$ e ->html ('html content ' );
298
298
$ e ->text ('text content ' );
299
299
$ e ->attach ($ file );
300
300
$ e ->attach ($ image , 'test.gif ' );
301
301
$ this ->assertEquals (new MixedPart (new AlternativePart ($ text , $ html ), $ att , $ img ), $ e ->getBody ());
302
302
303
- $ e = (new Email ())->from ('me@example.com ' );
303
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
304
304
$ e ->text ('text content ' );
305
305
$ e ->attach ($ file );
306
306
$ e ->attach ($ image , 'test.gif ' );
307
307
$ this ->assertEquals (new MixedPart ($ text , $ att , $ img ), $ e ->getBody ());
308
308
309
- $ e = (new Email ())->from ('me@example.com ' );
309
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
310
310
$ e ->html ($ content = 'html content <img src="test.gif"> ' );
311
311
$ e ->text ('text content ' );
312
312
$ e ->attach ($ file );
313
313
$ e ->attach ($ image , 'test.gif ' );
314
314
$ fullhtml = new TextPart ($ content , 'utf-8 ' , 'html ' );
315
315
$ this ->assertEquals (new MixedPart (new AlternativePart ($ text , $ fullhtml ), $ att , $ img ), $ e ->getBody ());
316
316
317
- $ e = (new Email ())->from ('me@example.com ' );
317
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
318
318
$ e ->html ($ content = 'html content <img src="cid:test.gif"> ' );
319
319
$ e ->text ('text content ' );
320
320
$ e ->attach ($ file );
@@ -334,7 +334,7 @@ public function testGenerateBody()
334
334
fwrite ($ r , $ content );
335
335
rewind ($ r );
336
336
337
- $ e = (new Email ())->from ('me@example.com ' );
337
+ $ e = (new Email ())->from ('me@example.com ' )-> to ( ' you@example.com ' ) ;
338
338
$ e ->html ($ r );
339
339
// embedding the same image twice results in one image only in the email
340
340
$ e ->embed ($ image , 'test.gif ' );
@@ -373,6 +373,7 @@ public function testSerialize()
373
373
374
374
$ e = new Email ();
375
375
$ e ->from ('fabien@symfony.com ' );
376
+ $ e ->to ('you@example.com ' );
376
377
$ e ->text ($ r );
377
378
$ e ->html ($ r );
378
379
$ name = __DIR__ .'/Fixtures/mimetypes/test ' ;
0 commit comments