Hi to all ...
How can I write to socket data to send MMS message?
I found this code to send SMS through socket ..
There is any away to add attachment and send it as a MMS message?
Code://iFileServer is RFs object iFileSession.Connect(); //iSockerServer is RSocketServ object iSocketServer.Connect(); //iSocket is RSocket Object TInt err1 = iSocket.Open(iSocketServer,KSMSAddrFamily, KSockDatagram, KSMSDatagramProtocol); if(!err1) { //SMS address for a socket. TSmsAddr smsaddr; //Only for sending, no reception. smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly); TInt BindErr1= iSocket.Bind(smsaddr); if(BindErr1 == KErrNone) { CSmsBuffer *buffer = CSmsBuffer::NewL(); CleanupStack::PushL(buffer); //Inserting msg. to be sent to a buffer buffer->InsertL(0, _L("MyMessage")); //Stream that writes a CSmsMessage object across a socket RSmsSocketWriteStream writestream(iSocket); //ESmsSubmit-SMS-SUBMIT, sent from Mobile Station to Service Center iSmsMessage = CSmsMessage::NewL(iFileSession,CSmsPDU::ESmsSubmit, buffer); //Sets the message Service Center Address via which msg. //will be sent to receipent iSmsMessage->SmsPDU().SetServiceCenterAddressL(_L("+01234567890")); //Sets destination number iSmsMessage->SmsPDU().SetToFromAddressL(_L("+09876543210")); //Externalises message to a stream which is used for //writing data into the socket iSmsMessage->ExternalizeL(writestream); //Ensures that any buffered data is written to the stream. writestream.CommitL(); TPckgBuf<TInt> sendBuffer; sendBuffer=KSockSelectWrite; //Applies an asynchronous I/O control operation on a socket. iSocket.Ioctl(KIoctlSendSmsMessage,iStatus,&sendBuffer,KSolSmsProv); iRead=EFalse; SetActive(); CleanupStack::PopAndDestroy(buffer);
Thanks.
Dvir.



