Mailer - Junk e-mail assistant | SMTP/Shell/CP/WP | Crax

Welcome To Crax.Pro Forum!

Check our new Marketplace at Crax.Shop

   Login! SignUp Now!
  • We are in solidarity with our brothers and sisters in Palestine. Free Palestine. To learn more visit this Page

  • Crax.Pro domain has been taken down!

    Alternatives: Craxpro.io | Craxpro.com

Mailer Junk e-mail assistant

Mailer Junk e-mail assistant

LV
0
 

ChillX

Member
Joined
Nov 5, 2023
Threads
1
Likes
0
Awards
1
Credits
220©
Cash
0$
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;

public class MassEmailSender {
public static void main(String[] args) {
// Sender's information
String fromEmail = "your_email@gmail.com";
String password = "your_password";

// SMTP server information
String smtpHost = "smtp.gmail.com";
int smtpPort = 587;

// Recipient information
String[] toEmails = {"recipient1@example.com", "recipient2@example.com"};

// Set JavaMail properties
Properties props = new Properties();
props.put("mail.smtp.host", smtpHost);
props.put("mail.smtp.port", smtpPort);
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");

// Create a Session object
Session session = Session.getInstance(props, new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(fromEmail, password);
}
});

try {
// Create a MimeMessage object
Message message = new MimeMessage(session);

// Set the sender
message.setFrom(new InternetAddress(fromEmail));

// Set the recipients
for (String toEmail : toEmails) {
message.addRecipient(Message.RecipientType.TO, new InternetAddress(toEmail));
}

// Set the email subject
message.setSubject("Mass Email Test");

// Set the email content
message.setText("This is a test email for mass mailing.");

// Send the email
Transport.send(message);

System.out.println("Email sent successfully");
} catch (MessagingException e) {
System.err.println("Email sending failed: " + e.getMessage());
}
}
}
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Top Bottom