clear([$clear_attachments = FALSE])
| Parameters: |
|
|---|---|
| Returns: |
CI_Email instance (method chaining) |
| Return type: |
CI_Email |
Initializes all the email variables to an empty state. This method is intended for use if you run the email sending method in a loop, permitting the data to be reset between cycles.
foreach ($list as $name => $address)
{
$this->email->clear();
$this->email->to($address);
$this->email->from('[email protected]');
$this->email->subject('Here is your info '.$name);
$this->email->message('Hi '.$name.' Here is the info you requested.');
$this->email->send();
}
If you set the parameter to TRUE any attachments will be cleared as well:
$this->email->clear(TRUE);
Please login to continue.