-
-
Save davideme/323e89e926346b7cd214927bf0753723 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sender { | |
public static void send(String type, String message, String to, String subject) { | |
if (type == "SMS") { | |
SMPP smpp = new SMPP("192.168.1.4", "4301"); | |
smpp.openConnection("yourusername", "yourpassword"); | |
smpp.send(to, message, null, "15"); | |
smpp.closeConnection(); | |
} else if(type == "mail") { | |
SendMailConnection smc = new SendMailConnection("mail.myserver.com"); | |
smc.prepareMessage(to, message, subject); | |
smc.send(); | |
smc.close(); | |
} else { | |
throw new RunTimeException("Type is unknown"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment