use PHPMessage\MessageEmail; $email = new MessageEmail("smtp.gmail.com", "youremail@gmail.com", "yourpassword"); $email->addTo("recipient@example.com", "Recipient Name"); $email->setSubject("Test Email"); $email->setBody("This is a test email sent from PHP Message."); $email->send();
use PHPMessage\MessageSMS; $sms = new MessageSMS("your-username", "your-password"); $sms->addRecipient("1234567890"); // the recipient's phone number $sms->setMessage("This is a test SMS sent from PHP Message."); $sms->send();
use PHPMessage\MessagePush; $push = new MessagePush("api-key", "api-secret"); $push->addRecipient("device-token"); // the recipient's device token $push->setMessage("This is a test push notification sent from PHP Message."); $push->send();This code creates an instance of `MessagePush` and sets the API key, API secret, recipient's device token, and message. Finally, the `send()` method is called to send the push notification. Overall, PHP Message is a useful package library for sending messages from PHP applications. It provides a simple and straightforward API for sending emails, SMSes, and push notifications.