Aller au contenu

magdayde

Membres
  • Compteur de contenus

    1
  • Inscription

  • Dernière visite

Réputation sur la communauté

0 Neutral

À propos de magdayde

  • Rang
    Junior Member

Autres informations

  • Mes langues
    français
  1. Bonjour, J'utilise curl pour envoyer des mails, en passant par l'API Orange de la manière suivante : curl.exe -o FicRetour.log -k -v -X POST -d @request.xml https://www.api-contact-everyone.fr....ltiDiffusionWS -H "Content-Type: text/xml; charset=UTF-8" -H "SOAPAction: "sendAdvancedMessage"" -H "Accept: */*" -H "Accept-Encoding: identity" -H "User-Agent: CURLTransport/1.1" le fichier request.xml : <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mul="MultiDiffusionWS"> <soapenv:Header> </soapenv:Header> <soapenv:Body> <mul:sendAdvancedMessage> <mul:wsAdvancedMessage> <mul:content>essai envoi mail</mul:content> <mul:custId>dddddd</mul:custId> <mul:from>yyyyy</mul:from> <mul:fullContenu>false</mul:fullContenu> <mul:mailReplyTo>pasdereponse@xxxx.fr</mul:mailReplyTo> <mul:orgName>1</mul:orgName> <mul:resumeContent>194</mul:resumeContent> <mul:sendProfiles><?xml version='1.0' encoding='ISO-8859-1'?> <PROFILE_LIST> <PROFILE> <DEST_NAME>jjj.kkk@kkk.fr</DEST_NAME> <DEST_FORENAME></DEST_FORENAME> <DEST_ID>Dest_1</DEST_ID> <TERMINAL_GROUP> <TERMINAL> <TERMINAL_NAME>mail</TERMINAL_NAME> <TERMINAL_ADDR>XXXXXXXXXXXXX</TERMINAL_ADDR> <MEDIA_TYPE_GROUP> <MEDIA_TYPE>mail_html</MEDIA_TYPE> </MEDIA_TYPE_GROUP> </TERMINAL> </TERMINAL_GROUP> </PROFILE> </PROFILE_LIST></mul:sendProfiles> <mul:strategy>mail</mul:strategy> <mul:subject>essai mail</mul:subject> <mul:to>XXXXXXXXXXXXXXXXXXXXXXXXXXX</mul:to> <mul:validFaxReplyTo>false</mul:validFaxReplyTo> <mul:validFormatMailReplyTo>false</mul:validFormatMailReplyTo> <mul:validMaxStartCall>false</mul:validMaxStartCall> <mul:validMinStartCall>false</mul:validMinStartCall> <mul:validSmsReplyTo>false</mul:validSmsReplyTo> <mul:validTelReplyTo>false</mul:validTelReplyTo> </mul:wsAdvancedMessage> </mul:sendAdvancedMessage> </soapenv:Body> </soapenv:Envelope> çà fonctionne très bien sauf que je veux insérer une pièce jointe à ce mail. Quand j'utilise le logiciel soapui, aucun souci; il me génére ceci en retour et je n'arrive pas à le transposer avec CURL. J'ai bien compris qu'il fallait utiliser curl -H....." pour les headers mais je ne sais pas comment déclarer le fichier que je veux joindre POST https://www.api-contact-everyone.fr....ltiDiffusionWS HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: multipart/related; type="text/xml"; start="<rootpart@soapui.org>"; boundary="----=_Part_2_1492295307.1508757055602" SOAPAction: "" MIME-Version: 1.0 Content-Length: 2770 Host: www.api-contact-everyone.fr.orange-business.com Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) ------=_Part_2_1492295307.1508757055602 Content-Type: text/xml; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-ID: <rootpart@soapui.org> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mul="MultiDiffusionWS"> <soapenv:Header> </soapenv:Header> <soapenv:Body> <mul:sendAdvancedMessage> <mul:wsAdvancedMessage> <mul:content>essai envoi mail</mul:content> <mul:custId>XXXXXXXXXXXXXXXX</mul:custId> <mul:from>XXXXXXXXXXXXXXX</mul:from> <mul:fullContenu>false</mul:fullContenu> <mul:mailReplyTo>XXXXXXXXXXXXXXXXXXXXXXX</mul:mailReplyTo> <mul:orgName>1</mul:orgName> <mul:resumeContent>194</mul:resumeContent> <mul:sendProfiles><![CDATA[<?xml version='1.0' encoding='ISO-8859-1'?> <PROFILE_LIST> <PROFILE> <DEST_NAME>XXXXXXXXXXXXXXX</DEST_NAME> <DEST_FORENAME></DEST_FORENAME> <DEST_ID>Dest_1</DEST_ID> <TERMINAL_GROUP> <TERMINAL> <TERMINAL_NAME>mail</TERMINAL_NAME> <TERMINAL_ADDR>XXXXXXXXXXXXXXXXXXX</TERMINAL_ADDR> <MEDIA_TYPE_GROUP> <MEDIA_TYPE>mail_html</MEDIA_TYPE> </MEDIA_TYPE_GROUP> </TERMINAL> </TERMINAL_GROUP> </PROFILE> </PROFILE_LIST>]]></mul:sendProfiles> <mul:strategy>mail</mul:strategy> <mul:subject>essai mail</mul:subject> <mul:to>XXXXXXXXXXXXXXXXXXXX</mul:to> <mul:validFaxReplyTo>false</mul:validFaxReplyTo> <mul:validFormatMailReplyTo>false</mul:validFormatMailReplyTo> <mul:validMaxStartCall>false</mul:validMaxStartCall> <mul:validMinStartCall>false</mul:validMinStartCall> <mul:validSmsReplyTo>false</mul:validSmsReplyTo> <mul:validTelReplyTo>false</mul:validTelReplyTo> </mul:wsAdvancedMessage> </mul:sendAdvancedMessage> </soapenv:Body> </soapenv:Envelope> ------=_Part_2_1492295307.1508757055602 Content-Type: text/plain; charset=Cp1252; name=envoimail.txt Content-Transfer-Encoding: quoted-printable Content-ID: <mdws-attached/envoimail.txt> Content-Disposition: attachment; name="envoimail.txt"; filename="envoimail.txt" Ceci est le texte =E0 envoyer par mail en piece jointe ------=_Part_2_1492295307.1508757055602-- Est-ce que quelqu"un pourrait m'aider svp. Merci
×