• Sergio Alcocer 5
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi All,
How to verify the email address generated by Email Services.
My Address is :
service_request_3@1aveejuzq7mszfwp1zvjvdpxu6wyrz644y6taufj41ze0beqvy.7f-1wjkduaa.ap5.apex.salesforce.com

And i am trying to verify this by writing code:

global class EmailVarification2 implements Messaging.InboundEmailHandler{
global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {
System.debug('Sent Mail');
Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
String[] sendingTo = new String[]{'rxxxxxx@gmail.com'};
semail.setToAddresses(sendingTo);
semail.setSubject('Verification!');
semail.setPlainTextBody(email.subject);
 for(OrgWideEmailAddress owa : [select id, Address, DisplayName from OrgWideEmailAddress]) 
    {
    if(owa.Address.contains('ssrr')) 
    semail.setOrgWideEmailAddressId(owa.id); 
    }
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {semail});
Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();

return result;
}
}

User-added image

I am not getting any email on mentioned email id: rxxxxx@gmail.com -Please guide