Send Email

To send an email the format is different to normal calls. The format is to call multiple methods to set the email properties.

Required methods are: to(array) subject(string) body(string/markup) send()

Note these methods expect an array to be passed:

  • to(['email@domains.com'])
  • cc(['email@domains.com'])
  • bcc(['email@domains.com'])
  • attachments(['path/to/file'])
MsGraph::emails()
->to(['email@domains.com'])
->subject('the subject')
->body('the content')
->send()

cc() and bcc and attachments are optional.

To send attachments pass an array of files paths

MsGraph::emails()
->to(['email@domains.com'])
->subject('the subject')
->body('the content')
->attachments([public_path('images/logo')])
->send()

 

Support my work by donating with PayPal.

Subscribe to my newsletter

Subscribe and get my books and product announcements.

© 2009 - 2021 DC Blog. All code MIT license. All rights reserved.