Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Public Class Account {
String accountService = null;
EmailService emailService = null;
public setAccountEmailProviderName(accountEmailProvider){
this.accountService = accountEmailProvider;
public void setupAccount(){
if (accountService == "google"){
emailService = Class.forName('GmailEmailProvider').getInstance();
else if(accountService == "yahoo"){
emailService = Class.forName('YahooEmailProvider').getInstance();
else {
emailService = Class.forName('HotmailEmailProvider').getInstance();
MailInit init = new MailInit(userName, password, emailService);
public Class MailInit{
public void initialConfiguration(String userName, String password, EmailService emailService ){
MailConfiguration.userName = userName;
MailConfiguration.password = password;
MailConfiguration.emailService = emailService;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.