Skip to content

Instantly share code, notes, and snippets.

@0xvoila 0xvoila/uml1.java
Last active May 9, 2017

Embed
What would you like to do?
public Class MailClient{
String emailServiceProvider;
String username;
String password;
public void initialConfiguration(String emailServiceProvider, String userName, String password){
this.emailServiceProvider = emailServiceProvider; // value google, yahoo
this.userName = userName; // account username
this.password = password; // account password
}
public void sendEmail(String recipient, String subject, String messageBody ){
if (this.emailServiceProvider == "google"){
// dummy gmail low level api
GMailLowLevelClass gmailLowLevelObject = new GMailLowLevelClass();
gmailLowLevelObject.connect(this.userName, this.password)
gmailLowLevelObject.send(receipient, subject, messageBody);
}
else if(this.emailServiceProvider == "yahoo"){
// dummy yahoo low level api
yahooLowLevelClass yahooLowLevelObject = new yahooLowLevelClass();
yahooLowLevelObject.connect(this.userName, this.password)
yahooLowLevelObject.send(receipient, subject, messageBody);
}
}
public String receiveEmail(){
if (this.emailServiceProvider == "google"){
GMailLowLevelClass gmailLowLevelObject = new GMailLowLevelClass();
gmailLowLevelObject.connect(this.userName, this.password)
gmailLowLevelObject.receiveEmail();
}
else (this.emailServiceProvider == "yahoo"){
yahooLowLevelClass yahooLowLevelObject = new yahooLowLevelClass();
yahooLowLevelObject.connect(this.userName, this.password)
yahooLowLevelObject.receiveEmail();
}
}
}
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.