Announcement Announcement Module
Collapse
No announcement yet.
Problems Sending email Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems Sending email

    Hello everyone!
    I'm having problems sending emails to accounts in public domains ex:yahoo.
    I'm using MS exchange server and able to send emails through intranet.Also I've an image file as an inline text and the image file looks wierd. Actually I found out that the image file gets corrupted not sure why..

    added the image file to web-inf/classes directory.

    here is the context.xml

    <bean id="emailSender" class="org.springframework.mail.javamail.JavaMailS enderImpl">
    <property name="host"><value>hostname</value></property>
    <!-- <property name="port"><value>what goes here?</value></property> -->
    <property name="username"><value>mywindowsloginname</value> </property>
    <property name="password"><value>myloginpwd</value></property>
    </bean>

    here is the code

    private JavaMailSender emailSender;
    public void setMailSender(JavaMailSender emailSender) {
    this.emailSender = emailSender;
    }



    emailSender.send(new MimeMessagePreparator() {
    public void prepare(MimeMessage mimeMessage) throws MessagingException {
    MimeMessageHelper message = new MimeMessageHelper(mimeMessage, true, "UTF-8");
    message.setTo(wc.getContact().getEmailAddress());

    message.setFrom("[email protected]");
    message.setSubject("test);
    message.setText(emailmsg,true);
    //email has html like this <img src='cid:Logo'>", true);

    message.addInline("companyLogo", new ClassPathResource
    ("logo.jpg") ) ;

    }
    });


    please advise..

    Thank you!
    lets

  • #2
    When you say weird what exactly to you mean? Does the image still render? Does it look lower quality or are parts of it obscured?

    Can you transmit e-mails successfully internally?

    Rob

    Comment


    • #3
      Image corrupted

      Yes, I can see that the image is embedded in the email message.
      All I can see is few lines exactly at the place where the image is supposed to be.
      Now when I looked up the location where the image I'm tring to load(web-inf/classes), the image itself is corrupted. So not sure why its getting corrputed after few e-mail messages are being sent.(Meaning first few images sent in e-mails worked fine).


      Yes I'm able to send emails correctly internally.and looks more like a configuration issue not sure thou..Our admin guy is working on it.

      Thanks,
      lets

      Comment

      Working...
      X