Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 7th June 2011, 17:55
marleyblu marleyblu is offline
Junior Member
Join Date: Jun 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem sending email with attachment

I'm new to using EWS from Exchangeclient classes.

I'm looking for a simple example how to send an email with an attachment. I've found examples about how to send an email but not sending an email with an attachment.

This is my script:
PHP Code:
$exchangeclient = new Exchangeclient();

I have the following soap request.
PHP Code:
$CreateItem->MessageDisposition "SendAndSaveCopy";
$CreateItem->SavedItemFolderId->DistinguishedFolderId->Id "sentitems";

$CreateItem->Items->Message->ItemClass "IPM.Note";
$CreateItem->Items->Message->Subject $subject;
$CreateItem->Items->Message->Body->BodyType $bodytype;
$CreateItem->Items->Message->ToRecipients->Mailbox->EmailAddress $to
$CreateItem->Items->Message->Attachments->FileAttachment->AttachmentId $attach['AttachmentId'];
$CreateItem->Items->Message->Attachments->FileAttachment->Name $attach['Name'];
$CreateItem->Items->Message->Attachments->FileAttachment->ContentType $attach['ContentType'];
$CreateItem->Items->Message->Attachments->FileAttachment->ContentId $attach['AttachmentId'];
$CreateItem->Items->Message->Attachments->FileAttachment->Content $attach['ContentId'];
$CreateItem->Items->Message->Attachments->FileAttachment->Size $attach['Size']; 
The error I am getting is:

Fatal error: Uncaught SoapFault exception: [a:ErrorSchemaValidation] The request failed schema validation: The required attribute 'Id' is missing.

Reply With Quote
Sponsored Links


php soap exchange

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mail.err warnings and some mail unable to receive HellMind General 4 8th October 2010 20:57
Email duplication problem sbbobd Installation/Configuration 9 15th February 2009 17:42
Postfix Email Delivery Problem sedat1903 HOWTO-Related Questions 2 22nd December 2008 12:19
CacheALL email problem no.2 Snowman General 2 2nd August 2007 10:45
sending email (connect, login) = slow TheRudy Server Operation 7 8th July 2006 13:46

All times are GMT +2. The time now is 17:35.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.