Hello,
I'm having a problem sending an email which has a picture attachment.
Here is my code:
function mailInit() {
var serviceListCB = function (services) {
if (services.length > 0) {
mailService = services[0];
}
tizen.messaging.getMessageServices("messaging.email", serviceListCB);
}
function sendEmail(content, emailAddress) {
var msg = new tizen.Message("messaging.email");
msg.attachments = [ new tizen.MessageAttachment("/opt/usr/media/Images/Default.jpg", "image/jpeg")];
msg.body.plainBody = content;
msg.to = [emailAddress];
mailService.sendMessage(msg,
function() {
console.log("message sending successful.");
},
function(e) {
console.log("message sending failed.");
}
);
}
//caller
mailInit();
function sendMessage() {
sendEmail("This is a test message.", "xxxx@gmail.com");
}
Problems:
First of all, I got an exception in this line:
msg.attachments = [ new tizen.MessageAttachment("/opt/usr/media/Images/Default.jpg", "image/jpeg")];
Exception is
- e: WebAPIError
- ABORT_ERR: 20
- AVPLAY_CURRUPTED_STREAM_ERR: 0
- AVPLAY_NETWORK_DISCONNECTED_ERR: 0
- AVPLAY_UNSUPPORTED_AUDIO_FORMAT_ERR: 0
- AVPLAY_UNSUPPORTED_VIDEO_FORMAT_ERR: 0
- AVPLAY_UNSUPPORTED_VIDEO_FRAMERATE_ERR: 0
- AVPLAY_UNSUPPORTED_VIDEO_RESOLUTION_ERR: 0
- DATA_CLONE_ERR: 25
- DOMSTRING_SIZE_ERR: 2
- FAIL_TO_PLAY_ERR: 0
- FAIL_TO_REQUEST_ERR: 0
- HIERARCHY_REQUEST_ERR: 3
- INDEX_SIZE_ERR: 1
- INUSE_ATTRIBUTE_ERR: 10
- INVALID_ACCESS_ERR: 15
- INVALID_CHARACTER_ERR: 5
- INVALID_DEVICE_ERR: 0
- INVALID_ITEM_ERR: 0
- INVALID_MODIFICATION_ERR: 13
- INVALID_NODE_TYPE_ERR: 24
- INVALID_RESPONSE_ERR: 0
- INVALID_STATE_ERR: 11
- INVALID_VALUES_ERR: 0
- IO_ERR: 0
- NAMESPACE_ERR: 14
- NETWORK_ERR: 19
- NOT_CONNECTED_SERVICE_ERR: 0
- NOT_FOUND_ERR: 8
- NOT_SUPPORTED_ERR: 9
- NOT_SUPPORTED_FUNCTION_ERR: 0
- NO_AVAILABLE_NETWORK_ERR: 0
- NO_DATA_ALLOWED_ERR: 6
- NO_MODIFICATION_ALLOWED_ERR: 7
- NO_PERMISSION_ERR: 0
- OUT_OF_MEMORY_ERR: 0
- QUOTA_EXCEEDED_ERR: 22
- SECURITY_ERR: 18
- SERVICE_NOT_AVAILABLE: 0
- SYNTAX_ERR: 12
- TIMEOUT_ERR: 23
- TYPE_MISMATCH_ERR: 17
- UNKNOWN_ERR: 0
- URL_MISMATCH_ERR: 21
- VALIDATION_ERR: 16
- WRONG_DOCUMENT_ERR: 4
- code: 8
- line: 63
- message: "Not Found"
- name: "NotFoundError"
- sourceURL: "file:///opt/usr/apps/eSe2354BUd/res/wgt/js/app.mail.js"
- stack: "[native code]↵App_sendsNote@file:///opt/usr/apps/eSe2354BUd/res/wgt/js/app.mail.js:63↵App_sendNote@file:///opt/usr/apps/eSe2354BUd/res/wgt/js/app.js:187↵NoteUi_handleSend@file:///opt/usr/apps/eSe2354BUd/res/wgt/js/app.ui.note.js:97↵NoteUi_handleSend@[native code]↵dispatch@file:///usr/share/tizen-web-ui-fw/latest/js/jquery.js:3063↵triggerCustomEvent@file:///usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js:2334↵clickHandler@file:///usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js:2410↵dispatch@file:///usr/share/tizen-web-ui-fw/latest/js/jquery.js:3063↵eventHandle@file:///usr/share/tizen-web-ui-fw/latest/js/jquery.js:2681↵trigger@file:///usr/share/tizen-web-ui-fw/latest/js/jquery.js:2946↵file:///usr/share/tizen-web-ui-fw/latest/js/jquery.js:3604↵each@file:///usr/share/tizen-web-ui-fw/latest/js/jquery.js:611↵each@file:///usr/share/tizen-web-ui-fw/latest/js/jquery.js:241↵trigger@file:///usr/share/tizen-web-ui-fw/latest/js/jquery.js:3605↵triggerVirtualEvent@file:///usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js:1965↵handleTouchEnd@file:///usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.js:2072↵dispatch@file:///usr/share/tizen-web-ui-fw/latest/js/jquery.js:3063↵eventHandle@file:///usr/share/tizen-web-ui-fw/latest/js/jquery.js:2681↵[native code]"
- type: "NotFoundError"
-
-
Secondly, I got an exception in
mailService.sendMessage and falls in the error callback function: error message is
- e: WebAPIError
- ABORT_ERR: 20
- code: 0
- message: "UnknownError"
- name: "UnknownError"
- type: "UnknownError"
Sorry for not organized posting but hope that helps to trace the issue.
Thanks
Christian.