+ Start a Discussion
Khaled YoussefKhaled Youssef 

send email after install

i have used the code below to send email after installation of by package , but i received an email from the email of client , how can i receive email from the server smtp ? 
global class MyInstallationHandler implements InstallHandler {
    global void onInstall(InstallContext argContext) {
        Messaging.SingleEmailMessage lEmail = new Messaging.SingleEmailMessage();
        lEmail.setSubject('Someone Installed my Package!! yay!');
        lEmail.setHtmlBody('Congrats, you have a new Client!');
        lEmail.setToAddresses(new List<String> {'test@test.com'});
        Messaging.sendEmail(new List<Messaging.Email> {lEmail}, false);