How to send New Email with Attachment using Zimbra API
-
- Posts: 16
- Joined: Fri Sep 12, 2014 11:56 pm
How to send New Email with Attachment using Zimbra API
Hi Guys,
I was trying to figure out how to send a new Email with attachment. When I looked at the soap.txt file, I saw that I have to upload the attachment first and then use the returned attachment-upload-ID for the SendMsgRequest.
I couldn't find any example or how to use the FileUploadServlet. Can anybody help me where to look for an example?
Thanks.
I was trying to figure out how to send a new Email with attachment. When I looked at the soap.txt file, I saw that I have to upload the attachment first and then use the returned attachment-upload-ID for the SendMsgRequest.
I couldn't find any example or how to use the FileUploadServlet. Can anybody help me where to look for an example?
Thanks.
How to send New Email with Attachment using Zimbra API
I have same problem.. there is no guide how to upload and use that id in request... did you get the solution ??
-
- Outstanding Member
- Posts: 360
- Joined: Fri Sep 12, 2014 11:59 pm
How to send New Email with Attachment using Zimbra API
Hope you know how to use SOAP by java.
You can use 2 SOAP requests to do this thing: FileUploadServlet and SendMsgRequest.
In the first step, you use FileUploadServlet to upload your message to server and get message's id from FileUploadServlet's response.
In SendMsgRequest, it has an attribute aid, all you need is giving it message's id.
You can use 2 SOAP requests to do this thing: FileUploadServlet and SendMsgRequest.
In the first step, you use FileUploadServlet to upload your message to server and get message's id from FileUploadServlet's response.
In SendMsgRequest, it has an attribute aid, all you need is giving it message's id.
How to send New Email with Attachment using Zimbra API
thank you dalmate for your reply. i know there are two steps to upload a file on server. but it would be best if the sample code is available to upload any file to zimbra. i know how to send message and how to add attachment id v. but don't know the exact code example about how to upload it.
Thank You
Thank You
How to send New Email with Attachment using Zimbra API
here is a link to a full documentation of zimbra soap API :- SOAP API Reference Material Beginning with ZCS 8.0 - Zimbra :: Wiki
-
- Outstanding Member
- Posts: 360
- Joined: Fri Sep 12, 2014 11:59 pm
How to send New Email with Attachment using Zimbra API
[quote user="parin"]here is a link to a full documentation of zimbra soap API :- SOAP API Reference Material Beginning with ZCS 8.0 - Zimbra :: Wiki[/QUOTE]
If you want to upload file to Zimbra, don't use SOAP because Zimbra does not have this service.
I recommend you use httpupload to upload to this url: http[s]://yourdomain.com/service/upload
If you want to upload file to Zimbra, don't use SOAP because Zimbra does not have this service.
I recommend you use httpupload to upload to this url: http[s]://yourdomain.com/service/upload
Re: How to send New Email with Attachment using Zimbra API
Actually I don't get any ID from the FileUploadServlet's response.13546dalmate wrote:
In the first step, you use FileUploadServlet to upload your message to server and get message's id from FileUploadServlet's response.
.
The response I get is something like
Code: Select all
200, null, 2443203b-c634-4404-be27-d837c7f7fbb7:3fbf9648-7977-40f7-8ee0-f20119d6cdbf
How to get the uploaded file ID please ?
Re: How to send New Email with Attachment using Zimbra API
Hello Parin,parin wrote:thank you dalmate for your reply. i know there are two steps to upload a file on server. but it would be best if the sample code is available to upload any file to zimbra. i know how to send message and how to add attachment id v. but don't know the exact code example about how to upload it.
Thank You
Did you managed to get the upload working and get message's id from FileUploadServlet's response ?
Thanks
Re: How to send New Email with Attachment using Zimbra API
manawa wrote:Actually I don't get any ID from the FileUploadServlet's response.13546dalmate wrote:
In the first step, you use FileUploadServlet to upload your message to server and get message's id from FileUploadServlet's response.
.
The response I get is something like
with the last number being a server token I presume.Code: Select all
200, null, 2443203b-c634-4404-be27-d837c7f7fbb7:3fbf9648-7977-40f7-8ee0-f20119d6cdbf
How to get the uploaded file ID please ?
Hi manawa,
I'm new on this and trying to send an email with attachment with soap.
I get an error when uploading the attachment to /service/upload, probably because I'm not doing right with the content then use httpPost.setEntity
I think you got it and that "2443203b-c634-4404-be27-d837c7f7fbb7:3fbf9648-7977-40f7-8ee0-f20119d6cdbf" is the aid (attachment id)
Could you tell me what java code you used to make the post to upload the attachment file?
Thanks and best regards
- barrydegraaff
- Zimbra Employee
- Posts: 242
- Joined: Tue Jun 17, 2014 3:31 am
- Contact:
Re: How to send New Email with Attachment using Zimbra API
In Java you can do:
https://github.com/Zimbra-Community/zim ... .java#L480
In javascript you can do:
https://github.com/Zimbra-Community/rma ... l.js#L1511
From the CLI on Zimbra you can use:
cat /tmp/youremailmsg | /opt/zimbra/common/sbin/sendmail account@example.com
see: https://help.dreamhost.com/hc/en-us/art ... -Sendmail-
https://github.com/Zimbra-Community/zim ... .java#L480
In javascript you can do:
https://github.com/Zimbra-Community/rma ... l.js#L1511
From the CLI on Zimbra you can use:
cat /tmp/youremailmsg | /opt/zimbra/common/sbin/sendmail account@example.com
see: https://help.dreamhost.com/hc/en-us/art ... -Sendmail-
--
Barry de Graaff
Email: barry.degraaff [at] synacor [dot] com
Admin of Zimbra-Community Github: https://github.com/orgs/Zimbra-Community/ and the
Zimlet Gallery https://gallery.zetalliance.org/extend/
Barry de Graaff
Email: barry.degraaff [at] synacor [dot] com
Admin of Zimbra-Community Github: https://github.com/orgs/Zimbra-Community/ and the
Zimlet Gallery https://gallery.zetalliance.org/extend/