• v.rudkov
  • NEWBIE
  • 5 Points
  • Member since 2016


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi all,
I am sending a single email from Apex code. Although I do not have any erros, the email doesn't get sent. As you can see from the code snippet, it is pretty uncomplicated. Wanted to do a test send before I get to the complicated stuff. There are not error messages but the email doesn't get sent. Any ideas???

Messaging.Singleemailmessage mail = new Messaging.Singleemailmessage();
mail.setToAddresses(new String[] {'terence1122@gmail.com'});
mail.setReplyTo('noreply@privatebudget.com');
mail.setSenderDisplayName('Private Budget App');
mail.setSubject('Private Budget records for ' + Date.today().month() + ' ' + Date.today().year());
mail.setBccSender(false);
mail.setUseSignature(false);
mail.setPlainTextBody('This is a test');
system.debug('@@@@ sendEmail - mail : ' + mail);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

The sytem debug produces the following
@@@@ sendEmail - mail : Messaging.SingleEmailMessage[getBccAddresses=null;getCcAddresses=null;getCharset=null;getDocumentAttachments=null;getFileAttachments=null;getHtmlBody=null;getInReplyTo=null;getOrgWideEmailAddressId=null;getPlainTextBody=This is a test;getReferences=null;getTargetObjectId=null;getTemplateId=null;getToAddresses=(terence1122@gmail.com);getWhatId=null;isUserMail=false;]

I am working on the dev org and executing the class which sends the mail from execute anonymous. 
Thanks