puedes subir tu imagen al servidor (al tuyo) y enviarla como un link, o, si no quieres esto tienes que conocer la forma de encriptar los datos de los email y mandarlo como attachment.
Problema de esto: si usas mail() y la imagen es muy grande no funcionará. Nunca lo he probado pero a veces mail() se bloquea enviando mensajes largos que no creo que ocupen más que una imagen.
Este es parte de un código PHP para enviar mail con attachments, según el autor dice que le funciona bien, pero tampoco se que envía como attachments.
No me lo he leido entero y no estoy seguro de como se usa, si eso te lo miro otro día que hoy estoy cansado.
Código PHP:
Ver original<?php
$to = $_POST['to'];
$email = $_POST['email'];
$name = $_POST['name'];
$subject = $_POST['subject'];
$comment = $_POST['message'];
$HTMLMessage =nl2br($comment);
$boundary1 =rand(0,9)."-" .rand(10000000000,9999999999)."-" .rand(10000000000,9999999999)."=:" $boundary2 =rand(0,9)."-".rand(10000000000,9999999999)."-" .rand(10000000000,9999999999)."=:"
for($i=0; $i < count($_FILES['youfile']['name']); $i++){ !empty($_FILES['fileatt']['size'][$i]) && !empty($_FILES['fileatt']['name'][$i])){
$attach ='yes';
$end ='';
$handle =fopen($_FILES['fileatt']['tmp_name'][$i], 'rb'); $f_contents =fread($handle, $_FILES['fileatt']['size'][$i]);
$ftype[] =$_FILES['fileatt']['type'][$i];
$fname[] =$_FILES['fileatt']['name'][$i];
}
}
/***************************************************************
Creating Email: Headers, BODY
1- HTML Email WIthout Attachment!! <<-------- H T M L ---------
***************************************************************/
#---->Headers Part
$Headers =<<<AKAM
From: $FromName <$FromEmail>
Reply-To: $FromEmail
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="$boundary1"
AKAM;
#---->BODY Part
$Body =<<<AKAM
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="$boundary1"
This is a multi-part message in MIME format.
--$boundary1
Content-Type: text/plain;
charset="windows-1256"
Content-Transfer-Encoding: quoted-printable
$TextMessage
--$boundary1
Content-Type: text/html;
charset="windows-1256"
Content-Transfer-Encoding: quoted-printable
$HTMLMessage
--$boundary1--
AKAM;
/***************************************************************
2- HTML Email WIth Multiple Attachment <<----- Attachment ------
***************************************************************/
if($attach=='yes') {
$attachments='';
$Headers =<<<AKAM
From: $FromName <$FromEmail>
Reply-To: $FromEmail
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="$boundary1"
AKAM;
for($j=0;$j<count($ftype); $j++){ $attachments.=<<<ATTA
--$boundary1
Content-Type: $ftype[$j];
name="$fname[$i]"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="$fname[$j]"
$attachment[$j]
ATTA;
}
$Body =<<<AKAM
This is a multi-part message in MIME format.
--$boundary1
Content-Type: multipart/alternative;
boundary="$boundary2"
--$boundary2
Content-Type: text/plain;
charset="windows-1256"
Content-Transfer-Encoding: quoted-printable
$TextMessage
--$boundary2
Content-Type: text/html;
charset="windows-1256"
Content-Transfer-Encoding: quoted-printable
$HTMLMessage
--$boundary2--
$attachments
--$boundary1--
AKAM;
}
/***************************************************************
Sending Email
***************************************************************/
$ok=mail($To, $Subject, $Body, $Headers); echo $ok?"<h1> Mail Sent</h1>":"<h1> Mail not SEND</h1>";
?>