locked
I was failed to send SMS to other multiple recipients after sent SMS to my own device? RRS feed

  • Question

  • I was failed to send SMS to other multiple recipients after sent SMS to my own device. The following is my code, anyone who will help me to solve it, thanks.

    // Open an SMS handle
    hRet = SmsOpen(SMS_MSGTYPE_TEXT, SMS_MODE_SEND, &hSMS, NULL);
    
    // Send SMS to different server number
    for(UINT i = 0; i < m_vServerNo.size(); i ++)
    {
        SecureZeroMemory(&smsaDestination, sizeof(smsaDestination));
        SecureZeroMemory(&tpsd, sizeof(tpsd));
    
        // Set up provider specific data.
        tpsd.dwMessageOptions   = PS_MESSAGE_OPTION_NONE;
        tpsd.psMessageClass     = PS_MESSAGE_CLASS1;
        tpsd.psReplaceOption    = PSRO_NONE;
        tpsd.dwHeaderDataSize   = 0;
    
        // Setting SMS Destination address.
        smsaDestination.smsatAddressType = SMSAT_INTERNATIONAL;
        hRet = StringCbCopy(smsaDestination.ptsAddress, SMS_MAX_ADDRESS_LENGTH, m_vServerNo.at(i));
    
        // Send SMS
        hRet = SmsSendMessage(  hSMS,
                                NULL, 
                                &smsaDestination,
                                NULL,
                                (PBYTE) szSMSContent,
                                _tcslen(szSMSContent) * sizeof(TCHAR),
                                (PBYTE) &tpsd, 
                                sizeof(TEXT_PROVIDER_SPECIFIC_DATA), 
                                SMSDE_OPTIMAL, 
                                SMS_OPTION_DELIVERY_NONE, 
                                &smsmidMessageID);
    
        //Sleep(5000);
    }
    
    Monday, May 18, 2009 6:21 AM

Answers

  • It is caused by own device's problems.
    • Marked as answer by Zeng_Zeng Wednesday, May 20, 2009 3:28 AM
    Wednesday, May 20, 2009 3:27 AM
  • Hi Zeng_Zeng,

    Do you mean that if you remove your phone number from m_vServerNo array, it will not fail. Please check it.

    If above is not the case, please provide completed code, without seeing the code, it is difficult to say why you are getting the problem.



    Best regards,
    Guang-Ming Bian - MSFT
    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Marked as answer by Zeng_Zeng Wednesday, May 20, 2009 3:37 AM
    Wednesday, May 20, 2009 3:33 AM

All replies

  • It is caused by own device's problems.
    • Marked as answer by Zeng_Zeng Wednesday, May 20, 2009 3:28 AM
    Wednesday, May 20, 2009 3:27 AM
  • Hi Zeng_Zeng,

    Do you mean that if you remove your phone number from m_vServerNo array, it will not fail. Please check it.

    If above is not the case, please provide completed code, without seeing the code, it is difficult to say why you are getting the problem.



    Best regards,
    Guang-Ming Bian - MSFT
    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Marked as answer by Zeng_Zeng Wednesday, May 20, 2009 3:37 AM
    Wednesday, May 20, 2009 3:33 AM
  • Thanks for your help.

    I have solved this bug, It is caused by own device's problems.
    Wednesday, May 20, 2009 3:38 AM