Distinguish visible and invisible attachments with Outlook VBA

As I can test so far, an embedded attachment always have a MIME content ID, regardless whether it appears in the mail body. So the solution is to check whether it has a content ID. Here is an example code that counts the visible attachments: Sub ShowVisibleAttachmentCount() Const PR_ATTACH_CONTENT_ID As String = “http://schemas.microsoft.com/mapi/proptag/0x3712001F” Const PR_ATTACHMENT_HIDDEN … Read more

How to send email with attachment using PHP?

I’d suggest to use a library for sending eMails as it will handle all the header related stuff. Have a look at Zend_Mail. Sending attachments is as easy as $mail = new Zend_Mail(); $at = $mail->createAttachment($myImage); $at->type=”image/gif”; $at->disposition = Zend_Mime::DISPOSITION_INLINE; $at->encoding = Zend_Mime::ENCODING_8BIT; $at->filename=”test.gif”; $mail->send();

Sending multiple attachment in an email using PHP

Answer There are a few problems with your code that I have detailed below. Line endings $headers=”From:”. $from . “\r\n”; $headers .= “Bcc:”. $bcc . “\r\n”; … // headers for attachment $headers .= “\nMIME-Version: 1.0\n” . “Content-Type: multipart/mixed;\n” . ” boundary=\”{$mime_boundary}\””; // multipart boundary $message = “This is a multi-part message in MIME format.\n\n” . … Read more

GMAIL API for sending Email with attachment

// Get the canvas from the DOM and turn it into base64-encoded png data. var canvas = document.getElementById(“canvas”); var dataUrl = canvas.toDataURL(); // The relevant data is after ‘base64,’. var pngData = dataUrl.split(‘base64,’)[1]; // Put the data in a regular multipart message with some text. var mail = [ ‘Content-Type: multipart/mixed; boundary=”foo_bar_baz”\r\n’, ‘MIME-Version: 1.0\r\n’, ‘From: … Read more

Sending mail attachment using Java

Working code, I have used Java Mail 1.4.7 jar import java.util.Properties; import javax.activation.*; import javax.mail.*; public class MailProjectClass { public static void main(String[] args) { final String username = “your.mail.id@gmail.com”; final String password = “your.password”; Properties props = new Properties(); props.put(“mail.smtp.auth”, true); props.put(“mail.smtp.starttls.enable”, true); props.put(“mail.smtp.host”, “smtp.gmail.com”); props.put(“mail.smtp.port”, “587”); Session session = Session.getInstance(props, new javax.mail.Authenticator() { … Read more

How to send an email with a file attachment in Android

Use the below code to send a file within a email. String filename=”contacts_sid.vcf”; File filelocation = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), filename); Uri path = Uri.fromFile(filelocation); Intent emailIntent = new Intent(Intent.ACTION_SEND); // set the type to ’email’ emailIntent .setType(“vnd.android.cursor.dir/email”); String to[] = {“asd@gmail.com”}; emailIntent .putExtra(Intent.EXTRA_EMAIL, to); // the attachment emailIntent .putExtra(Intent.EXTRA_STREAM, path); // the mail subject emailIntent .putExtra(Intent.EXTRA_SUBJECT, … Read more

How to attach two or multiple files and send mail in PHP [duplicate]

<form action=”#” method=”POST” enctype=”multipart/form-data” > <input type=”file” name=”csv_file[]” /> <br/> <input type=”file” name=”csv_file[]” /> <br/> <input type=”file” name=”csv_file[]” /> <br/> <input type=”submit” name=”upload” value=”Upload” /> <br/> </form> <?php if($_POST) { for($i=0; $i < count($_FILES[‘csv_file’][‘name’]); $i++){ $ftype[] = $_FILES[‘csv_file’][‘type’][$i]; $fname[] = $_FILES[‘csv_file’][‘name’][$i]; } // array with filenames to be sent as attachment $files = $fname; // … Read more

tech