[eluser]tnathos[/eluser]
hi i have a problem.. i try to make a image whit gd and send attach in email.. but doesnt works.. know what the problem here in pass the img to the function attach but i dont know how resolve this.
Code:
header("Content-type: image/gif");
//session_start();
$img1 = imagecreatefromgif("fnd_kupon.gif");
$img2 = imagecreatefromgif("img_loading.gif");
$color = imagecolorallocate($img1,0,0,0);
imagestring($img1, 5, 12, 8, 'AAAAAAAAAAAA', $color);
imagecopymerge($img1,$img2,0,0,0,0,200,75,80);
imagegif($img1, 'NEWIMAGE.GIF');
$this->load->library('email');
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'mail.mail.com';
$config['smtp_user'] = '[email protected]';
$config['mail_type'] = 'html';
$this->email->initialize($config);
$this->email->from('[email protected]');
$this->email->to($emailk);
$this->email->subject('Haz generado un en ');
$this->email->message('Adjunto encontraras el kupon generado para la promocion seleccionada, si no tienes impresora puedes presentar el siguiente codigo con el cual tendras acceso a la promocion');
$this->email->attach('NEWIMAGE.GIF');
imagedestroy($img2);
imagedestroy($img1);
return $this->email->send();
}