All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.republicate.mailer.EmailSender Maven / Gradle / Ivy

There is a newer version: 1.6
Show newest version
package com.republicate.mailer;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class EmailSender
{
    public static void send(String from,String to,String subject,String body) throws IOException
    {
        send(from,to,subject,body,"text",(List)null);
    }

    public static void send(String from,String to,String subject,String body,String type) throws IOException
    {
        send(from,to,subject,body,type,(List)null);
    }

    public static void send(String from,String to,String subject,String body,String type,String att) throws IOException
    {
        List lst = null;
        if(att != null && att.length() > 0)
        {
            lst = new ArrayList();
            lst.add(att);
        }
        send(from,to,subject,body,type,lst);
    }

    public static void send(String from,String to,String subject,String body,String type,List attrLst) throws IOException
    {
        send(from, to, from, subject, body, type, attrLst);
    }

    public static void send(String from, String to, String replyTo, String subject, String body, String type, List attrlst) throws IOException
    {
        send(from, to, replyTo, subject, body, type, attrlst, null);
    }

    public static void send(String from, String to, String replyTo, String subject, String body, String type, List attrlst, Object callbackData) throws IOException
    {
        if (!SmtpLoop.isRunning())
        {
            throw new IOException("smtp loop is not running");
        }
        MessageParams messageParams = new MessageParams(from,to,replyTo,subject,body,type,attrlst,callbackData);
        SmtpLoop.sendMessage(messageParams);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy