curl -X POST "https://api.mail.sb/send" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "sender_name=[YOUR_NAME]&sender_address=[YOUR_EMAIL_ADDRESS]&password=[YOUR_PASSWORD]&recipient_name=[RECIPIENT_NAME]&recipient_address=[RECIPIENT_ADDRESS]&mail_subject=[MAIL_SUBJECT]&mail_body=[MAIL_BODY]"
curl -X POST "https://api.mail.sb/send" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "sender_name=[YOUR_NAME]&sender_address=[YOUR_EMAIL_ADDRESS]&password=[YOUR_PASSWORD]&recipient_name=[RECIPIENT_NAME]&recipient_address=[RECIPIENT_ADDRESS]&mail_subject=[MAIL_SUBJECT]&mail_body=[MAIL_BODY]"
|
<?php
// Define the required data
$sender_name = 'YOUR_NAME';
$sender_address = 'YOUR_EMAIL_ADDRESS';
$password = 'YOUR_PASSWORD';
$recipient_name = 'RECIPIENT_NAME';
$recipient_address = 'RECIPIENT_ADDRESS';
$mail_subject = 'MAIL_SUBJECT';
$mail_body = 'MAIL_BODY';// Set the URL and the POST fields
$url = "https://api.mail.sb/send";
$post_fields = http_build_query(array(
'sender_name' => $sender_name,
'sender_address' => $sender_address,
'password' => $password,
'recipient_name' => $recipient_name,
'recipient_address' => $recipient_address,
'mail_subject' => $mail_subject,
'mail_body' => $mail_body
));// Initialize cURL
$ch = curl_init();// Set the options for the cURL request
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // To capture the response
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/x-www-form-urlencoded'
));// Execute the cURL request and capture the response
$response = curl_exec($ch);// Check for errors in the cURL request
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo 'Response: ' . $response;
}// Close the cURL session
curl_close($ch);
?>