// [CRUCIBLE-SEED]
// category: hardcoded_secret
// severity: critical
// language: java
// expected: Hardcoded SMTP password used for email authentication

import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;

public class EmailNotifier {
    private static final String SMTP_HOST     = "smtp.company.com";
    private static final String SMTP_USER     = "notifications@company.com";
    private static final String SMTP_PASSWORD = "N0tif!c@ti0nP@ss#2024";

    public void sendAlert(String to, String subject, String body) throws MessagingException {
        Properties props = new Properties();
        props.put("mail.smtp.auth", "true");
        props.put("mail.smtp.host", SMTP_HOST);
        props.put("mail.smtp.port", "587");

        Session session = Session.getInstance(props, new Authenticator() {
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(SMTP_USER, SMTP_PASSWORD);
            }
        });
        Message msg = new MimeMessage(session);
        msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to));
        msg.setSubject(subject);
        msg.setText(body);
        Transport.send(msg);
    }
}
