I am new to StackOverflow in terms of posting anything. Please excuse me if I am not doing this properly.
I have found a post that shows how to integrate Mailgun API within Codeigniter and it works well. Please see here - How to work with Mailgun API in CodeIgniter; Forbidden error in curl_exe()
My problem comes when I want to attach a pdf in the same piece of code. instead of using
$this->mailgun::send([
'from' => "Example.com team <no-reply@mg.example.com>",
'to' => "somerandomuser@gmail.com",
'subject' => "Welcome to Example.com",
'text' => "We just want to say hi. Have fun at Example.com"
]);
I had hoped to use the following:
$this->mailgun->send([
'from' => "Web Admin <postmaster@xxxxxx.xxxxxs.org>",
'to' => $toemail,
'subject' => $subj,
'text' => $bodtxt,
'html' => $bod,
'attachment' => curl_file_create($increport , 'application/pdf', $increportnm),
'h:Reply-To' => $replyname . ' <' . $replyemail . '>'
]);
Where $increport is the path to my pdf file and $increportnm is the name of the pdf file.
When I run this, there is no email posted to Mailgun :(
Can anyone help me out?