Phpmailer Attachment Executable

[ENGLISH]

I’m trying to send an email by phpmailer and add “.zip” attachment with content “.exe”.

I can send ".zip" but without ".exe" inside.

I know that gmail dont accept ".exe" but the gmail page accept ".zip" with content ".exe" and phpmailer dont accept it.

The error that appear is: "SMTP Error: Data not accepted".

This is my code:


Yii::import('application.extensions.phpmailer.JPhpMailer');

$mail = new JPhpMailer;

$mail->Timeout = 3000;

$mail->IsSMTP();

$mail->SMTPAuth = true;

$mail->CharSet = 'UTF-8';

$mail->Host = 'smtp.gmail.com:465';

$mail->SMTPSecure = "ssl";

$mail->IsHTML(true);

$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

//$mail->SMTPDebug = true;

		

$mail->Username = 'correo@correo.com';

$mail->Password = '*********';

		

$mail->SetFrom('froman.ext@cygitsolutions.com', 'FernandoFROM');

$mail->AddAddress('froman.ext@cygitsolutions.com', 'FernandoTO');

		

$mail->Subject = $nombre;

$mail->Body    = 'Fichero adjunto enviado desde YiiFrameworks.<br><br>

		  ·Nombre del fichero: '.$nombre.'<br>';

$mail->AddAttachment(attachment.zip);

$mail->Send();

fclose($input);


[ESPAÑOL]

Estoy intentando enviar un correo por phpmailer e insertar un fichero adjunto ".zip" que contiene un ".exe".

El codigo permite enviar ".zip" sin contenido ".exe".

El error que me aparece es : "SMTP Error: Data not accepted".

Consigo enviar todo tipo de ficheros, excepto ".exe" y ".zip" que contienen ".exe".

Entiendo que gmail no acepte los ".exe" porque nos trata como virus, pero entrando desde la pagina de gmail, si me acepta los ".zip" que contienen ".exe" y phpmailer no me lo acepta.

Este es mi codigo:


Yii::import('application.extensions.phpmailer.JPhpMailer');

$mail = new JPhpMailer;

$mail->Timeout = 3000;

$mail->IsSMTP();

$mail->SMTPAuth = true;

$mail->CharSet = 'UTF-8';

$mail->Host = 'smtp.gmail.com:465';

$mail->SMTPSecure = "ssl";

$mail->IsHTML(true);

$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

//$mail->SMTPDebug = true;

		

$mail->Username = 'correo@correo.com';

$mail->Password = '*********';

		

$mail->SetFrom('froman.ext@cygitsolutions.com', 'FernandoFROM');

$mail->AddAddress('froman.ext@cygitsolutions.com', 'FernandoTO');

		

$mail->Subject = $nombre;

$mail->Body    = 'Fichero adjunto enviado desde YiiFrameworks.<br><br>

		  ·Nombre del fichero: '.$nombre.'<br>';

$mail->AddAttachment(attachment.zip);

$mail->Send();

fclose($input);

Hello,

you cannot send or receive emails with exe, dll, ocx, com or bat attachments even if they are sent in a zipped (.zip, .tar, .tgz, .taz, .z, .gz) format (The .rar format is still allowed).

You will find this at following link.

please try to attach using rar format. And let me know.

Thanks…