summaryrefslogtreecommitdiff
path: root/it_mail.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_mail.class')
-rw-r--r--it_mail.class8
1 files changed, 4 insertions, 4 deletions
diff --git a/it_mail.class b/it_mail.class
index 3e56a08..161d3d1 100644
--- a/it_mail.class
+++ b/it_mail.class
@@ -149,7 +149,7 @@ function add_attachment($data, $p = array(), $legacy_name = null)
$p = array('mimetype' => $p) + ($legacy_name ? array('name' => $legacy_name) : array());
$this->attachments[] = $p + array(
- 'cid' => $cid = md5(uniqid(rand())),
+ 'cid' => $cid = bin2hex(random_bytes(16)),
'data' => $data,
'disposition' => "inline",
'mimetype' => "application/octet-stream",
@@ -208,7 +208,7 @@ function send($p = array())
if ($this->attachments)
{
/* Attachments need multipart MIME mail */
- $boundary1 = md5(uniqid(rand()));
+ $boundary1 = bin2hex(random_bytes(16));
$mixedtype = "Content-Type: multipart/mixed; boundary=\"$boundary1\"";
$headers[] = $mixedtype;
@@ -224,7 +224,7 @@ function send($p = array())
{
if ($this->body[IT_MAIL_HTML])
{
- $boundary2 = md5(uniqid(rand()));
+ $boundary2 = bin2hex(random_bytes(16));
$alternativetype = "Content-Type: multipart/alternative; boundary=\"$boundary2\"";
/* Plain and HTML */
@@ -257,7 +257,7 @@ function send($p = array())
{
if (strstr($this->body[IT_MAIL_HTML], "cid:"))
{
- $boundary3 = md5(uniqid(rand()));
+ $boundary3 = bin2hex(random_bytes(16));
$text .= "Content-Type: multipart/related; boundary=\"$boundary3\"\n\n--$boundary3\n";
}