Как получить сумму от отношений в Laravel

Уровень класса:

public String sendEmailToUsers(String emailId,String subject, String name){
    String result =null;
    MimeMessage message =mailSender.createMimeMessage();
    try {

        MimeMessageHelper helper = new MimeMessageHelper(message, false, "utf-8");
        String htmlMsg = "<body style='border:2px solid black'>"
                    +"Your onetime password for registration is  " 
                        + "Please use this OTP to complete your new user registration."+
                          "OTP is confidential, do not share this  with anyone.</body>";
        message.setContent(htmlMsg, "text/html");
        helper.setTo(emailId);
        helper.setSubject(subject);
        result="success";
        mailSender.send(message);
    } catch (MessagingException e) {
        throw new MailParseException(e);
    }finally {
        if(result !="success"){
            result="fail";
        }
    }

    return result;

}

Уровень XML:

    <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
    <property name="host" value="smtp.gmail.com" />
    <property name="port" value="587" />
    <property name="username" value="********@gmail.com" />
    <property name="password" value="********" />
    <property name="javaMailProperties">
        <props>
            <prop key="mail.transport.protocol">smtp</prop>
            <prop key="mail.smtp.auth">true</prop>
            <prop key="mail.smtp.starttls.enable">true</prop>
        </props>
    </property>
</bean>
0
задан ASMSaief 18 March 2019 в 13:40
поделиться