473,786 Members | 2,775 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[JAVAMAIL 1.3.1][SDK 1.4.2_04] - Cc-Header

hi together.

public void sendMail(String body, String subject, String sender, String to,
String copy) {
String server = "srv.domain.com ";
String toList = null;
Properties props = new Properties();

props.put("mail .smtp.host", server);
props.put("mail .smtp.sendparti al", "true");
Session session = Session.getDefa ultInstance(pro ps, null);

try {
InternetAddress from = new InternetAddress (sender,true);
InternetAddress[] replyto = {new InternetAddress (sender,true)};
InternetAddress[] sendto = {new InternetAddress (to)};
Object objBody = new String(body);

MimeMessage myMsg = new MimeMessage(ses sion);
DataHandler myData = new DataHandler(obj Body,
"text/plain");

URLName myURL = new
URLName("SMTP", server,-1,"","applet"," ");
SMTPTransport myTra = new SMTPTransport(s ession, myURL);

myMsg.setReplyT o(replyto);
myMsg.setFrom(f rom);
if (copy != null) {
InternetAddress[] copyto = {new InternetAddress (copy)};
myMsg.setRecipi ents(Message.Re cipientType.CC, copyto);
}

myMsg.setHeader ("X-Mailer", "Applet Best-1.000-04/2004");
myMsg.setSentDa te(new java.util.Date( ));
myMsg.setSubjec t(subject, "iso-8859-1");
myMsg.setDataHa ndler(myData);

SMTPMessage smtpMsg = new SMTPMessage((Mi meMessage) myMsg);

myTra.connect() ;
myTra.sendMessa ge(smtpMsg, sendto);
}
catch (MessagingExcep tion mex) {
mex.printStackT race();
Exception ex = null;
if ((ex = mex.getNextExce ption()) != null) {
ex.printStackTr ace();
}
}
}

those function send mail and works, except the copyto user. he gets no mail.
the mail looks...:

Return-Path: <replyto>
Delivered-To: from
Received: from srv.domain.com (srv.domain.com [192.168.1.45])
by mail.domain.com (Postfix) with ESMTP id BF02B9A404D
for <sendto>; Wed, 21 Apr 2004 11:28:36 +0200 (CEST)
Received: from localhost (dv02na.domain. com [192.168.1.70])
by srv.domain.com (8.11.6/8.11.6) with ESMTP id i3L9STr03234
for <sendto>; Wed, 21 Apr 2004 11:28:29 +0200
Message-ID: <5626111.108253 9715500.JavaMai l.javamailuser@ localhost>
Date: Wed, 21 Apr 2004 11:28:35 +0200 (CEST)
From: from Reply-To: replyto
Subject: Bestellung Artikel
Cc: copyto
Mime-Version: 1.0
Content-Type: text/plain; charset=Cp1252
Content-Transfer-Encoding: quoted-printable
X-Mailer: JavaClient/Applet Best-1.000-04/2004

....

i have changed the mail system values to the var names in the source, they
are ok.
the header sequence is unchanged.

a look in source shows, that the cc-header is in third place, if exists.
in the produced mail the cc-header is behind the subject-header. causes
these the trouble?

thanks in advance
volker
Jul 17 '05 #1
0 1929

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1689
by: WEC | last post by:
Can anny one tell me 2 thingss 1) what is the curent SDK for java 2? 2) what is with the request for the password? WEC
1
2192
by: Joshua | last post by:
Ive playedw ith the standard pop3 and imap and nntp and smtp modules but am unconvinced -- I would like to find a more sophisticated email handling API like JavaMail (from which I hope to convert). Can anyone recommend anything? (Ive gone through some o fhte stuff from the Vaults of Parnussus and some of the stuff in the PyPI but am as of yet unable to find something worthwhile. Anyhelp is greatlya ppreciated, thanks in advance, Joshua
1
2115
by: Trent | last post by:
Hello, all. Does anyone know if IBMJava2-SDK-1.4.2-0.0 work with DB2 8.2? I tried it with DB2 8.2 and got some error. This server is a RH3ES with kernel 2.4.21.4 ========================================================= $ db2cc & 2378 $ Exception in thread "main" java.lang.NoClassDefFoundE
5
2406
by: rengaraj | last post by:
Hello , I try a simple javamail program to send a mail.When i execute that javamail program, i got the error as follows import java.util.*; import javax.mail.*; import javax.mail.internet.*; import javax.activation.*;
0
1250
by: libia | last post by:
Hello, I want to send a mail using java program .so i used javamail 1.4 and jaf 1.1.It was compiled successfully.If i run the program it gives the error that "unable to connect" to port 25.If there is any free smtp server.How to find the smtp host address?.Those who are familar in javamail please give ur suggestions. Kind regards, Roch
0
9650
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6748
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.