+ Start a Discussion
santoshsantosh 

sendEmail returns success with no Email

Hi all,
 
In .NET, I am using v9.0. My sendEmail call is returning success but no Emails are actually being sent. This happens all the time. Can anyone please guide me with this? Thanks.
SuperfellSuperfell
Can you post your code ?
santoshsantosh

Sure, Here it is:

I picked it up from the docs.

binding object has been declared and instantiated.

SingleEmailMessage[] messages = new SingleEmailMessage[1];
        messages[0] = new SingleEmailMessage();
        messages[0].bccAddresses = new String[] { "email@email.com", "email@email.com" };
        messages[0].ccAddresses = new String[] { "email@email.com", "email@email.com" };
        messages[0].bccSender = true;
        messages[0].emailPriority = EmailPriority.High;
        messages[0].replyTo = "email@email.com";
        messages[0].saveAsActivity = true;
        messages[0].subject = "This is how you use the sendEmail call.";
        //We can also just use an id for an implicit to address
        //messages[0].setTargetObjectId("003D0000005OV0g");
        //messages[0].setUseSignature(true);
        messages[0].plainTextBody = "This is the humongous body of the message.";
        String[] toAddresses = { "email@email.com" };
        messages[0].toAddresses = toAddresses;
        //binding.

        try
        {
            SendEmailResult[] result = binding.sendEmail(messages);
        }
        catch (Exception ex)
        {
            throw ex;
        }

Thanks Simon.

SuperfellSuperfell
but you're not checking the result to see if it wa successful.
santoshsantosh

It was...I checked it while debugging in Visual Studio.

Any clues? Thanks.

SuperfellSuperfell
Please log a case with support.