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.
Reply
 
Thread Tools Display Modes
  #1  
Old 7th June 2011, 16: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();
$exchangeclient->init($username$passwordNULL'ews/Services.wsdl');
$exchangeclient->send_message($mail_from$subject$body'HTML'truetrue); 

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->Body->$content;
    
$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.

Thanks.
Reply With Quote
Sponsored Links
Reply

Bookmarks

Tags
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 19:57
Email duplication problem sbbobd Installation/Configuration 9 15th February 2009 16:42
Postfix Email Delivery Problem sedat1903 HOWTO-Related Questions 2 22nd December 2008 11:19
CacheALL email problem no.2 Snowman General 2 2nd August 2007 09:45
sending email (connect, login) = slow TheRudy Server Operation 7 8th July 2006 12:46


All times are GMT +2. The time now is 16:43.


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