Not able to get the type of MessageType in email app of symbian 3rd - symbian

I want to develpoe an app which sends email from IMAP4 settings of the phone.
And I am following this perticular wiki.
RSendAs send;
User::LeaveIfError(send.Connect());
CleanupClosePushL(send);
RSendAsMessage sendMsg;
sendMsg.CreateL(send,**KUidMsgTypeSMTP** );
CleanupClosePushL(sendMsg);
sendMsg.SetSubjectL(_L("Incident Capture."));
sendMsg.AddRecipientL(_L("abc#xyz.com"),RSendAsMessage::ESendAsRecipientTo);
sendMsg.SetBodyTextL(_L("Image Attached"));
TRequestStatus status;
//add attachment
sendMsg.AddAttachment(_L("C:\\Data\\Images\\hhj.jpg"),status);
User::WaitForRequest(status);
sendMsg.SendMessageAndCloseL();
CleanupStack::Pop();
CleanupStack::PopAndDestroy();
Now I want KUidMsgtypeSMTP Uid. I am not getting how to use this thing.
How do I get the value of this constant.
when I used random Hex value 0x040, it gave me System Error (-1) at run time.
Thanks in advance.

You need to #include <miutset.h> system header as it contains
const TUid KUidMsgTypeSMTP = {0x10001028}; // 268439592

Related

I am trying to make this mineflayer bot attack specific players mentioned in chat

Is there a way to give the bot a command, and type someone's username in chat with the command, for example, "attack (username)", and have it attack that player?
const target = bot.players[username] ? bot.players[username].entity : null;
if(!target){
//action if requested player doesn't exist
}
bot.attack(target);

The Badge number is constantly increasing, even after I use the setBadgeNumber(0) method

I'm using the Distriqt PushNotifications ANE and PARSE to send PushNotifications, and so far everything is working PERFECTLY.
This means, I register my iOS devices and receive PushNotifications as it should be....
When I send PushNotifications with PARSE I use the badge:"Increment" value, which understandably increments the Value By +1.
After I open the App, I want to reset the BADGE to be at 0 and I use the setBadgeNumber(0) method... This also works, I tried with other values like 11, or 1 and it displays it correctly.
The Problem is that when I send another PARSE notification it displays now the old value + 1 !!!
Like so:
I use PARSE to send 3 PushNotifications
The badge displays (3)
I use the setBadgeNumber(0)
The badge displays (0)
I use PARSE to send 2 additional PushNotifications
The badge displays (5)!!!!
How can I really reset the badge?
The value of the badge is actually sent as part of the push notification payload, eg:
{
"aps" : {
"alert" : "Notification content",
"badge" : 5
}
}
You should double check what Parse is actually sending as it will be keeping a count of the notifications and sending that as part of the payload, so you will either need to disable this in Parse or notify Parse of your user resetting / changing the count.
Calling setBadgeNumber just changes the icon on the application and doesn't update Parse of this change.
You could look into the Parse ANE which helps out with this process:
http://airnativeextensions.com/extension/com.distriqt.Parse

Is it possible to send a single message to multiple numbers at a time using Twilio?

I'm developing an app that allows users to add people, info, and Name/phone, or select multiple numbers from their iPhone contact list to send SMS messages to the selected numbers. the problem is Twillio API needs to be call every time per number. Is their any way to call the API once for multiple numbers?
Is it possible to send message to multiple number at a time?
Is it possible to send multiple messages?
Thanks in advance
It's not possible, you need to iterate through the list and make one request per message (which is probably better than batching it and dealing with the potential of multiple errors / resends).
Each new SMS message from Twilio must be sent with a separate REST API request. To initiate messages to a list of recipients, you must make a request for each number to which you would like to send a message. The best way to do this is to build an array of the recipients and iterate through each phone number.
const numbersToMessage = ["+15558675310", "+14158141829", "+15017122661"]
numbersToMessage.forEach(async number => {
const message = await client.messages.create({
body: 'message body',
from: '+16468635472',
to: number
});
console.log(message.status)
});
Yes this is possible. Infact i'm trying to do the same thing at the moment(which is why i'm here) and Twilio has some advanced stuff that lets us achieve this.
Assuming you have a twilio ssid, twilio auth token and a twilio phone number, the next thing you have to do is create a "Twilio Messaging Service" from the dashboard. You can use the ssid of the created messaging service and use or if you want to send a message to like 10k numbers in one go, you create a "Twilio Notify Service" from the dashboard which takes the previously created messaging service as part of its configuration. Once this is done you can call the twilio.notifications.create() and pass bindings({ binding_type: 'sms', address: number }) for each phone number to it.
Complete explanation found in this twilio blog right here with perfectly working code.
https://www.twilio.com/blog/2017/12/send-bulk-sms-twilio-node-js.html
Yes it is possible to send message to multiple user's from your Twilio Number.
You can try this for your node.js file:
var arr = ["+1xxxxxxxxxx","+1xxxxxxxxx"];
arr.forEach(function(value){console.log(value);
client.messages.create({
to:value,
from: "+19253504188",
body: msg,
}, function(err,message){
console.log(err);
});
});
Yes it is possible. You have to provide the numbers as a list and iterate API call.
For example send a message to two numbers.
numbers = ['+1234562525','+1552645232']
for number in numbers:
proxy_client = TwilioHttpClient()
proxy_client.session.proxies = {'https': os.environ['https_proxy']}
client = Client(account_sid, auth_token, http_client=proxy_client)
message = client.messages \
.create(
body="Your message",
from_='Your Twilio number',
to=number
)

YiiMail sending attachment

In my Project i am using YiiMail extension to send mail to the users. in which i am attaching a file. but the problem is its not possible to send the mail using the attachment. my mail code is given below.
$this->email->setBody('<p>'.$email.'-'.$name.'-'.$details.'</p>', 'text/html');
$this->email->from = "test#test.com";
$this->email->setSubject('Direct Request');
$this->email->attach(CUploadedFile::getInstanceByName('fileupload'));
$this->email->setTo(array($emailId => 'test#test.com'));
with this code the mail is not sending and error message is showing.
Argument 1 passed to Swift_Mime_SimpleMessage::attach() must implement interface Swift_Mime_MimeEntity, instance of CUploadedFile given
what is reason this error is showing and any solution for this.
thanks in advance
You need to convert your file attachment to a SwiftMailer Swift_Mime_MimeEntity type. CUploadedFile::getInstanceByName('fileupload') returns a CUploadedFile class, which SwiftMailer does not know how to handle. More on Swift attachments here.
I have not tested this, but you will need to do something like this:
$uploadedFile = CUploadedFile::getInstanceByName('fileupload'); // get the CUploadedFile
$uploadedFileName = $uploadedFile->tempName; // will be something like 'myfile.jpg'
$swiftAttachment = Swift_Attachment::fromPath($uploadedFileName); // create a Swift Attachment
$this->email->attach($swiftAttachment); // now attach the correct type
Good luck!

How to check email using a vb.net application

I am looking for a vb.net code for receiving e-mails without using any 3rd party libraries. I want to check Unread messages, Inbox and Sent messages. A Working sample is appreciated.
What is the default port for SMTP , is it port 25 (is it the same for all SMTP mail servers?). Which is more flexible in my case POP3 or IMAP ?
Edit:
Someone please give me a sample working code for receiving mail using lumisoft (pop) in vb.net
From lumisoft Help.
/*
To make this code to work, you need to import following namespaces:
using LumiSoft.Net.Mime;
using LumiSoft.Net.POP3.Client;
*/
using(POP3_Client c = new POP3_Client()){
c.Connect("ivx",WellKnownPorts.POP3);
c.Authenticate("test","test",true);
// Get first message if there is any
if(c.Messages.Count > 0){
// Do your suff
// Parse message
Mime m = Mime.Parse(c.Messages[0].MessageToByte());
string from = m.MainEntity.From;
string subject = m.MainEntity.Subject;
// ...
}
}
Pop is more supported and most servers have it on if you want to implement your own pop service a good place to start is the rfc.