473,804 Members | 3,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Construct a Nested Multipart mail

Hi

I used pear api to make this mail but I can t add multipart.My mail
structure is like that.

part 1: a file
part 2: multipart
part 1: a file
part 2: a file

Content-Type: multipart/related; boundary="----
=_Part_1130_313 45073.111268980 4895"; type="text/xml";
start="31518250 .1112689804903. apache-soap.edison1"
Content-Length: 2062
SOAPAction: "urn:mm7Deliver Req"

------=_Part_1130_313 45073.111268980 4895
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: <31518250.11126 89804903.apache-soap.edison1>
Content-Length: 888

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/
envelope/" xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Header>
<mm7:Transactio nID SOAP-ENV:mustUnderst and="1" xmlns:mm7="http ://www.
3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-
MM7-1-2">64*******@mm s.turkcell.com. tr</mm7:Transaction ID>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<mm7:DeliverR eq xmlns:mm7="http ://www.3gpp.org/ftp/Specs/archive/
23_series/23.140/schema/REL-5-MM7-1-2">
<MM7Version>5.3 .0</MM7Version><Lin kedID>73******* @mms.turkcell.c om.tr</
LinkedID><Subje ct>Alo</Subject><Sender ><Number>053221 01678</Number></
Sender><Recipie nts><To><Number >280</Number></To></
Recipients><Tim eStamp>2005-04-05T11:30:04Z</
TimeStamp><Prio rity>Normal</Priority></mm7:DeliverReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

------=_Part_1130_313 45073.111268980 4895
Content-Type: multipart/related; boundary="----
=_Part_6520_340 2311.1112689804 772"

------=_Part_6520_340 2311.1112689804 772
Content-Type: application/smil; name=main.smil; charset=utf-8
Content-Transfer-Encoding: 7bit
Content-ID: <AAAA>

<smil><head><la yout><root-layout backgroundColor ="#FFFFFF" background-
color="#FFFFFF" height="480px" width="640px"/>
<region id="Image" top="0" left="0" height="50%" width="100%"
fit="meet"/>
<region id="Text" top="50%" left="0" height="50%" width="100%"
fit="meet"/>
</layout>
</head>
<body><par dur="4000ms"><t ext src="smil.txt" region="Text">< param
name="foregroun d-color" value="#000000"/>
</text>
</par>
</body>
</smil>

------=_Part_6520_340 2311.1112689804 772
Content-Type: text/plain; name=smil.txt; charset=utf-8
Content-Transfer-Encoding: 7bit
Content-Location: smil.txt

Alo
------=_Part_6520_340 2311.1112689804 772--

------=_Part_1130_313 45073.111268980 4895--

I searched and test pear api(mimepart.ph p) but I cant make this.
function mmsCombiner( $env) {
global $requestAttachm ents;
//print_r($reques tAttachments);
$params['content_type'] = 'multipart/related';
$mimeMessage =& new Mail_mimePart(' ', $params);
unset($params);

$params['content_type'] = 'text/xml';
$params['encoding'] = '8bit';
$params['charset'] = 'utf-8';
$mimeMessage->addSubpart($en v, $params);

$paramsInner['content_type'] = 'multipart/related';
$mimeInnerMessa ge =& new Mail_mimePart(' ', $paramsInner);
foreach ($requestAttach ments as $att) {
unset($paramsIn ner);
$paramsInner['content_type'] = $att['contenttype'];
// TODO it must be changed
$paramsInner['encoding'] = '7bit';
//$params['disposition'] = 'attachment';
$paramsInner['dfilename'] = $att['filename'];
$paramsInner['cid'] = $att['cid'];
if ($att['data'] == '' && $att['filename'] <'') {
if ($fd = fopen($att['filename'], 'rb')) {
$data = fread($fd, filesize($att['filename']));
fclose($fd);
} else {
$data = '';
}
$mimeInnerMessa ge->addSubpart($da ta, $paramsInner);
} else {
$mimeInnerMessa ge->addSubpart($at t['data'], $paramsInner);
}
}

$outputInner = $mimeInnerMessa ge->encode();
$mimeInnerHeade rs = $outputInner['headers'];
$headInner ="";
foreach ($mimeInnerHead ers as $k =$v) {
$headInner.="$k : $v \n";
//echo $headInner;
}

$attachment = $headInner."\n" .$outputInner['body'];
unset($paramsIn ner);

$paramsInner['content_type'] = 'multipart/related';
//print_r($params Inner);
$mimeMessage->addSubpart($at tachment, array());
$output = $mimeMessage->encode();
$mimeHeaders = $output['headers'];
$head ="";
foreach ($mimeHeaders as $k =$v) {
$head.="$k: $v \n";
}
//return $attachment;
echo $head."\n".$out put['body'];
//return $head."\n".$out put['body'];
}

How can I achieve to construct nested multipart?

thanks.

Apr 21 '07 #1
2 3425
Hello,

on 04/21/2007 07:14 AM gezerpunta said the following:
How can I achieve to construct nested multipart?
I don't know if it is possible to achieve that with PEAR Mail, but you
certainly can with this popular MIME message composing and sending class.

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Apr 22 '07 #2
Hello

Better use phpmailer at sourceforge.com .
It is best script for this. I always suggest this script. It has all
solution for mail problem.
satya61229.blog spot.com
------------------------------------------------------------------------------------
On Apr 21, 6:14 am, gezerpunta <css...@gmail.c omwrote:
Hi

I used pear api to make this mail but I can t add multipart.My mail
structure is like that.

part 1: a file
part 2: multipart
part 1: a file
part 2: a file

Content-Type: multipart/related; boundary="----
=_Part_1130_313 45073.111268980 4895"; type="text/xml";
start="31518250 .1112689804903. apache-soap.edison1"
Content-Length: 2062
SOAPAction: "urn:mm7Deliver Req"

------=_Part_1130_313 45073.111268980 4895
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: <31518250.11126 89804903.apache-soap.edison1>
Content-Length: 888

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/
envelope/" xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Header>
<mm7:Transactio nID SOAP-ENV:mustUnderst and="1" xmlns:mm7="http ://www.
3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-
MM7-1-2">644087...@mm s.turkcell.com. tr</mm7:Transaction ID>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<mm7:DeliverR eq xmlns:mm7="http ://www.3gpp.org/ftp/Specs/archive/
23_series/23.140/schema/REL-5-MM7-1-2">
<MM7Version>5.3 .0</MM7Version><Lin kedID>738609... @mms.turkcell.c om.tr</
LinkedID><Subje ct>Alo</Subject><Sender ><Number>053221 01678</Number></
Sender><Recipie nts><To><Number >280</Number></To></
Recipients><Tim eStamp>2005-04-05T11:30:04Z</
TimeStamp><Prio rity>Normal</Priority></mm7:DeliverReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

------=_Part_1130_313 45073.111268980 4895
Content-Type: multipart/related; boundary="----
=_Part_6520_340 2311.1112689804 772"

------=_Part_6520_340 2311.1112689804 772
Content-Type: application/smil; name=main.smil; charset=utf-8
Content-Transfer-Encoding: 7bit
Content-ID: <AAAA>

<smil><head><la yout><root-layout backgroundColor ="#FFFFFF" background-
color="#FFFFFF" height="480px" width="640px"/>
<region id="Image" top="0" left="0" height="50%" width="100%"
fit="meet"/>
<region id="Text" top="50%" left="0" height="50%" width="100%"
fit="meet"/>
</layout>
</head>
<body><par dur="4000ms"><t ext src="smil.txt" region="Text">< param
name="foregroun d-color" value="#000000"/>
</text>
</par>
</body>
</smil>

------=_Part_6520_340 2311.1112689804 772
Content-Type: text/plain; name=smil.txt; charset=utf-8
Content-Transfer-Encoding: 7bit
Content-Location: smil.txt

Alo
------=_Part_6520_340 2311.1112689804 772--

------=_Part_1130_313 45073.111268980 4895--

I searched and test pear api(mimepart.ph p) but I cant make this.
function mmsCombiner( $env) {
global $requestAttachm ents;
//print_r($reques tAttachments);
$params['content_type'] = 'multipart/related';
$mimeMessage =& new Mail_mimePart(' ', $params);
unset($params);

$params['content_type'] = 'text/xml';
$params['encoding'] = '8bit';
$params['charset'] = 'utf-8';
$mimeMessage->addSubpart($en v, $params);

$paramsInner['content_type'] = 'multipart/related';
$mimeInnerMessa ge =& new Mail_mimePart(' ', $paramsInner);
foreach ($requestAttach ments as $att) {
unset($paramsIn ner);
$paramsInner['content_type'] = $att['contenttype'];
// TODO it must be changed
$paramsInner['encoding'] = '7bit';
//$params['disposition'] = 'attachment';
$paramsInner['dfilename'] = $att['filename'];
$paramsInner['cid'] = $att['cid'];
if ($att['data'] == '' && $att['filename'] <'') {
if ($fd = fopen($att['filename'], 'rb')) {
$data = fread($fd, filesize($att['filename']));
fclose($fd);
} else {
$data = '';
}
$mimeInnerMessa ge->addSubpart($da ta, $paramsInner);
} else {
$mimeInnerMessa ge->addSubpart($at t['data'], $paramsInner);
}
}

$outputInner = $mimeInnerMessa ge->encode();
$mimeInnerHeade rs = $outputInner['headers'];
$headInner ="";
foreach ($mimeInnerHead ers as $k =$v) {
$headInner.="$k : $v \n";
//echo $headInner;
}

$attachment = $headInner."\n" .$outputInner['body'];
unset($paramsIn ner);

$paramsInner['content_type'] = 'multipart/related';
//print_r($params Inner);
$mimeMessage->addSubpart($at tachment, array());
$output = $mimeMessage->encode();
$mimeHeaders = $output['headers'];
$head ="";
foreach ($mimeHeaders as $k =$v) {
$head.="$k: $v \n";
}
//return $attachment;
echo $head."\n".$out put['body'];
//return $head."\n".$out put['body'];
}

How can I achieve to construct nested multipart?

thanks.

Apr 23 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2946
by: LRW | last post by:
Because I've had recipients of our newsletter tell us they can't (or won't) receive HTML e-mail, I found out how to make an e-mail that sends both HTML and a plaintext version in a multipart message. Problem is, while the HTML version shows up fine in HTML enabled clients like Outlook, in plaintext clients it either shows nothing in the body or just an attachment link to the message source code. I've tried different encodings and bits...
2
3206
by: Damien | last post by:
Hi to all, After hours of attempts and "googling", I'm still pulling my hair off my head when I try to send multipart html emails. It "works" on PCs with Outlook when I juste send a single "related" mail: one part for the HTML body, and several for the images. However, the images do not show on a Mac. I also wanted to have an "alternate", plain text message. I've tried the method described by Zend and PHPBuilder, but no luck...
5
14239
by: lucanos | last post by:
Hey All, I'm having trouble trying to create a PHP file which will generate a multipart email message (containing both an HTML formatted part and a Plain Text formatted part). I have Googled for it, and found previous entries in Google Groups, but I just can't get it to work. My PHP File contains the following:
2
5046
by: Der tolle Emil | last post by:
Hi! I wrote a little function to send emails which works quite well. I already managed to send attachments correctly (also more than 1 per email) but I am not able to send a HTML mail containing a text only block for non-HTML clients. I will not post the PHP code as I think it is irrelevant, the error lies within the mail header and/or body, so here is the mail I do want to send: FROM: me <foo@bar.com>
6
15421
by: deko | last post by:
How do I construct an XHTML-compliant nested unordered list? This displays correctly (both FF and IE): <ul> <li>list item</li> <li>list item</li> <li>list item</li> <ul> <li>nested list item</li>
0
2801
by: sachintandon | last post by:
Hello all, Thanks in advance for your help I have a problem in sending emails, my requirement is to send multipart alternative emails with attachments, I'm able to send text with attachments or HTML mails with attachments, but some mail clients are not able to display the html mails that is why I need to send multipart alternative emails, when I used multipart/alternative then I'm not able to send attachments and if I use the multipart/mixed...
0
1178
by: =?Utf-8?B?Tmljb2w=?= | last post by:
Hi, I ahve developed an application to send mails with attachment to a common mail box say "help@company.com". All the mail that comes to this mailbox will be read by some application. All my attachments from my web page goes perfectly to the mailbox. But when the file is opened from the "help@comapny.com" hro' web mail, I am able to see http://web....../L/1_multipart_xF8FF_2_a.txt/C58EA28C-18C0-4a97-9AF2-036E93DDAFB3/a.txt?attach=1...
4
2887
by: ceh | last post by:
Hi, on windows xp I'm using xampp v 1.6.4 I'm trying to send mail. The mail always sends, but the multipart sections are broken. Essentially, I want to send an html email that has a link it, like http://www.google.com so the reader can click on the link. When I get the email, the body is empty.
3
2552
by: =?GB2312?B?0rvK18qr?= | last post by:
Hi all, Recently I asked a question on this group: I got these suggestion: 1) try construct
0
9706
marktang
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...
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10317
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,...
0
10075
tracyyun
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...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
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
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.