Hi,
I'm writing a php code to send email in mime format.
All seams ok if I read the email with outlook express, or Thunderbird,
or any webmail, but if I open the email with Outlook 2003, I can't see
the images, I just see a small box (I send 1 image) with inside the
path of the image.
The image is embedded in the message, it's not a link.
What am I doing wrong???
Here is the code:
<?php
$header = "From: Sender <sen...@domain. org>\n";
$header .= "CC: Altro Ricevente <blabla...@doma in.net>\n";
$header .= "X-Mailer: Our Php\n";
$boundary = "==String_Bound ary_x" .md5(time()). "x";
$boundary2 = "==String_Bound ary2_y" .md5(time()). "y";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: multipart/related;\n";
$header .= " type=\"multipar t/alternative\";\ n";
$header .= " boundary=\"$bou ndary\";\n\n";
$messaggio = "If you read this, your email client doesn't support MIME
\n\n";
$message .= "--$boundary\n";
$messag .= "Content-Type: multipart/alternative;\n" ;
$message .= " boundary=\"$bou ndary2\";\n\n";
$message .= "--$boundary2\n";
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= "Alternativ e message in plain text format.\n\n";
$message .= "--$boundary2\n";
$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= "<html><body><p >This message is in <i>html</iformat but
has a plain text part.</p><p>Visit the website <a href=\"http://
www.xxxxxx.com\ ">www.xxxxxxxxx .com</a><img src=\"cid:image 1\"></p></
body></html>\n";
$message .= "--$boundary2--\n";
$message .= "--$boundary\n";
$message .= "Content-ID: <image1>\n";
$message .= "Content-Type: image/jpeg\n";
$message .= "Content-Transfer-Encoding: base64\n\n";
$attached = "./images/image1.jpg";
$file = fopen($attached ,'rb');
$data = fread($file,fil esize($attached ));
fclose($file);
$data = chunk_split(bas e64_encode($dat a));
$message .= "$data\n\n" ;
$message .= "--$boundary--\n";
$subject = "message with inline(embedded ) image";
if( @mail("recei... @domain.com", $subject, $message, $header) ) echo
"e-mail sent!";
else echo "error sending the e-mail!";
?> 2 2605
On 12 Feb, 11:30, "Andrea" <andr...@tin.it wrote:
Hi,
I'm writing a php code to send email in mime format.
All seams ok if I read the email with outlook express, or Thunderbird,
or any webmail, but if I open the email with Outlook 2003, I can't see
the images, I just see a small box (I send 1 image) with inside the
path of the image.
The image is embedded in the message, it's not a link.
What am I doing wrong???
Here is the code:
<?php
$header = "From: Sender <sen...@domain. org>\n";
$header .= "CC: Altro Ricevente <blabla...@doma in.net>\n";
$header .= "X-Mailer: Our Php\n";
$boundary = "==String_Bound ary_x" .md5(time()). "x";
$boundary2 = "==String_Bound ary2_y" .md5(time()). "y";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: multipart/related;\n";
$header .= " type=\"multipar t/alternative\";\ n";
$header .= " boundary=\"$bou ndary\";\n\n";
$messaggio = "If you read this, your email client doesn't support MIME
\n\n";
$message .= "--$boundary\n";
$messag .= "Content-Type: multipart/alternative;\n" ;
$message .= " boundary=\"$bou ndary2\";\n\n";
$message .= "--$boundary2\n";
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= "Alternativ e message in plain text format.\n\n";
$message .= "--$boundary2\n";
$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: 7bit\n\n";
$message .= "<html><body><p >This message is in <i>html</iformat but
has a plain text part.</p><p>Visit the website <a href=\"http://www.xxxxxx.com\ ">www.xxxxxxxxx .com</a><img src=\"cid:image 1\"></p></
body></html>\n";
$message .= "--$boundary2--\n";
$message .= "--$boundary\n";
$message .= "Content-ID: <image1>\n";
$message .= "Content-Type: image/jpeg\n";
$message .= "Content-Transfer-Encoding: base64\n\n";
$attached = "./images/image1.jpg";
$file = fopen($attached ,'rb');
$data = fread($file,fil esize($attached ));
fclose($file);
$data = chunk_split(bas e64_encode($dat a));
$message .= "$data\n\n" ;
$message .= "--$boundary--\n";
$subject = "message with inline(embedded ) image";
if( @mail("recei... @domain.com", $subject, $message, $header) ) echo
"e-mail sent!";
else echo "error sending the e-mail!";
?>
Can you see images in anoy other emails in Outlook? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Ron Holmes |
last post by:
I want to place a background image on a windows form. Is there a way to
prevent the image from Tiling without using an image box resized to the size
of the form?
I am using Visual Studio 2003 .NET. This is an easy thing to do in VB6.
|
by: MLH |
last post by:
Is the following remotely correct?
=DDE("C:\Program Files\Program Files\Outlook
Express\OEmig50","Attachment","Name")
I'm not sure that OEmig50.exe is the executable
for OE. Anybody know?
I find no list of TOPICS to use with the DDE
related commands in Access Basic or VBA
|
by: WillShakespeare |
last post by:
Following an intro article from the msdn homepage about using C# to access
the Outlook 2003 Object Model in Applications and Add-Ins, I came across a
problem with the OPine example.
I was reading through the article on the C# msdn home page about introducing
the Outlook 2003 Object Model through C#.
I carefully programmed the OPine example, but after ironing out reference
errors and syntax, etc., I finally had this one annoying error....
|
by: Jurjen de Groot |
last post by:
The IE webControls come with standard graphics for the treeview amongst
other things, does anyone know of other sets of images so the treeview
doesn't look so much like the Windows Explorer tree but a little more
sophisticated ?
Kind regards,
Jurjen de Groot
Netherlands
|
by: Arun |
last post by:
Hi,
I have simple question to ask. How to write multiple Binary files to the
Browser using Asp.Net and Visual C#.net
I have seen examples where single binary file is written to browser.
-Regards
Arun
| |
by: Rob D. |
last post by:
Hi,
I move from using Outlook Express to Outlook 2003.
In Express, when I type the first few letters of a recipients name in the
To... field, the whole e-mail address will show up. THe problem is this does
not happen in Outlook 2003. What do I have to do to have the recipients names
automatically come up just by typing the first few letters of there name,
like in express. Please advise. Thanks!
|
by: Trapulo |
last post by:
Hello,
I need to send an email from vb.net. The body may be html encoded, and all
images related to the html (<img src....>) may be embedded in the email
content instead of refer to remote urls.
I've tried a lot of solution, but I can only get a message with images
embedded but no html, or message with html but no images embedded. What is
the right way to have this goal?
I have a dictionary with <image name, image content as byte...
|
by: =?Utf-8?B?U2VyZW5h?= |
last post by:
For some reason .jpg attachments, infact any attachments in outlook express
have all of a sudden decieded to take ages to open but if saved on the hard
disc they open in a flash. i use Windows XP Pro, Outlook Express 6, Office
2003, i have searched the net for anyone that might have similar problems but
only came up with someone that had the same problem in Microsoft Outlook 2003
which i dont use. and the solution directions did not match...
|
by: PW |
last post by:
Hi,
A client of ours is having problems using our email interface. Our
application is written in Access 2003 and the client is using
Microosft Outlook Express version 6. We use the DoCmd SendObject
syntax and they are receiving the error "The command or action
'SendObject' isn't available now."
Using Internet Explorer we go to Tools/Options and the default email
program is set to Outlook Express.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |