How to identify bounced mails thru java mail??
Hi everyone,
I have a Javamail program through which I m sending and receiving mails. I want to identify bounced mails from the ones I receive. Is there a way in the Javamail API or the SMTP protocol to detect if the mail recd is a bounced one?? Some header or something???
Any inputs will be great...
There's no need to ask twice.
http://forum.java.sun.com/thread.jsp?forum=43&thread=176301
Similar Messages
-
How to identify received mail is failure delivery notice mail in javamail?
Hi friends,
My requirement is that i have to identify failure delivery notice mails while receiving mails through javamail api pop3..
Is there anyway to idenity those among normal mails?
luking forward ur replies dudes...If you search this forum you'll find some examples, including a simple modification
to the msgshow.java demo program to illustrate the basic use. And don't forget
to read the javadocs for the com.sun.mail.dsn package.
The basics are...
Check for a message of type "multipart/report" (isMimeType), fetch the content of
that message (getContent) and cast it to a MultipartReport object, then use the
methods of that object to extract the data and process it however you want. -
Urgent!!! how to trap bounced back mails thru java mail
Hi,
I want to trap a bounced back thro java mail. Is there any way out. Please help. Its urgent.Sure. Just look at your incoming mail and identify the ones that are the bounce messages. That's easy to say, but there is no standard for the format of a bounce message, so every mail server uses their own. However, you can generally identify them by their subject lines; you'll have to look at some actual bounce messages to decide what to look for. So far I have found about 10 different formats.
-
How to identify the name of my smtp-mail host dynamically?
Hi,
I want to send an email from my system which has an internet connection.
I don't know how to identify and mention the name of my smtp server ie; the smtp-host name that should be mentioned in my propetries object 'props' as props("mail.smtp.host","smtphostname");
I want this program to work on other systems also,ie; It should dynamically find out what is the smtp-email host for the computer on which the program is running and set the smtp-host name in the 'properties' object dynamically.
I will be thankful if anybody sends me code to solve this problem.
Thank u in advance,
Ravi.Write a mail scan to look for typical settings
such as domain, mail.domain, smtp.domain, smtp.mail.domain
where domain is after @ in an email address
Have a SocketSearch class that uses non blocking via java.nio.channels.*
so it can be interruptable and scan for these typical mail settings on default port 25 - The code using these interruptable socket can each be threaded to find the host/port and should find it in seconds
Once found, store the settings in a configuration so you don't have to scan again unless it doesn't work anymore...
If can't find the socket host/port via typical settings, next use a Java class that does a nslookup based on MX records - For example if you type "nslookup -type=mx javasoft.com" and you get mail exchanger = mail.java.sun.com and if you "telnet mail.java.sun.com 25" - you can see the port is open for sending emails.
No expert in MX records for a domain to find the exact one and someone else can share some light on this... -
How to connect client mail through java mail.
Hi all,
I want to open client Mail with specified file as attachement. Is it possible to do thru java mail API. other wise can any one suggest me how can i proceed this.
Kindly do needfull
Thanks and Regards,
Mohan RaoYou can both send attachments and receive attachments using JavaMail API. There's a tutorial on the JGuru site that gives a good overview - http://java.sun.com/developer/onlineTraining/JavaMail/ .
Good Luck :)
∞ brew.man ∞ -
How can we identify the mails from the mails that have been read previousy
Hi
i m using java mail api to fetch the mails. but i am facing a problem that is every time i fetch all the mails in my application.
Is there any way by which i can set a flag or something so as to i can identify the mails which have been processed earliar.
please help me out.
Dushyant KumarPOP3, right? See the JavaMail FAQ.
-
How to send a mail by ckicking the button using java
hi,
how to send a mail by clicking the button (like payroll silp in that contain one button if we click that it autometically go through the mail as a attachment) pls frd to me my gmail is [email protected]Hi,
It seems we are doing the homework for you; to make you start with something; look at the sample code below and try to understand it first then put the right values
to send an email with an attachement.
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.util.Date;
import java.util.Properties;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JTextField;
public class Main {
* @param args
public static void main(String[] args) {
// Create the frame
String title = "Frame Title";
JFrame frame = new JFrame(title);
// Create a component to add to the frame
JComponent comp = new JTextField();
Action action = new AbstractAction("Button Label") {
// This method is called when the button is pressed
public void actionPerformed(ActionEvent evt) {
System.out.println("sending email with attachment");
sendEmail();
// Create the button
JButton button = new JButton(action);
// Add the component to the frame's content pane;
// by default, the content pane has a border layout
frame.getContentPane().add(comp, BorderLayout.SOUTH);
frame.getContentPane().add(button, BorderLayout.NORTH);
// Show the frame
int width = 300;
int height = 300;
frame.setSize(width, height);
frame.setVisible(true);
protected static void sendEmail() {
String from = "me@localhost";
String to = "me@localhost";
String subject = "Important Message";
String bodyText = "This is a important message with attachment";
String filename = "c:\\tmp\\message.pdf";
Properties properties = new Properties();
properties.put("mail.stmp.host", "localhost");
properties.put("mail.smtp.port", "25");
Session session = Session.getDefaultInstance(properties, null);
try {
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.setRecipient(Message.RecipientType.TO, new InternetAddress(
to));
message.setSubject(subject);
message.setSentDate(new Date());
// Set the email message text.
MimeBodyPart messagePart = new MimeBodyPart();
messagePart.setText(bodyText);
// Set the email attachment file
MimeBodyPart attachmentPart = new MimeBodyPart();
FileDataSource fileDataSource = new FileDataSource(filename) {
@Override
public String getContentType() {
return "application/octet-stream";
attachmentPart.setDataHandler(new DataHandler(fileDataSource));
attachmentPart.setFileName(filename);
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messagePart);
multipart.addBodyPart(attachmentPart);
message.setContent(multipart);
Transport.send(message);
} catch (MessagingException e) {
e.printStackTrace();
}The sample above is not ideal so you need to go through it and start to ask me some questions if you have
Let me know if you miss something
Regards,
Alan Mehio
London,UK -
How to read a mail from sap inbox thru abap code?
how to read a mail from sap INBOX thru abap code? can anyone tell me the technical approach? I NEED TO READ A MAIL and then need to pass the parameters to a bapi.
Message was edited by:
shahid mohammed syedHi SSM,
Did you manage to have your program working? I also have same requirement. I tried standard FM and BAPI but I always encounter authorization error when I tried accessing other user's mail. Thanks.
Regards,
Ryan -
How to undo bounce setting of a specific e-mail address
Hi,
A while ago, I bounced mail from unwanted company (not SPAM), and it worked. Circumstances have changed (long story), and I want to again receive e-mail from this person. Any way to "unbounce" or undo a bounce of a specific address? Thanks!
LauraFYI - see my post at http://discussions.apple.com/message.jspa?messageID=5166335#5166335
Additionally, as I suspected/expected, but just to verify, I sent a second message from work to home after I bounced the first, no problem -- it just goes and gets delivered like nothing ever happened.
So, your problem is a non-problem. No problem. -
Please help How can i run Os commands thru Java programs
Hey,
I want to stop and restart the linux server thru java program.Is it possible to run the os commands thru java program.
I had it thru Runtime.getRuntime().exec("*.exe");
it only runs the exe files.How can run files other than exe files like .bat,com ans shell commands..Any body knows please help with the code..or mail to this address
[email protected]
thankyou,
regards,
j.mouliWhat about "start command.com /C execute.bat", or using the overload that takes a String[] as argument?
What if you use the the full path of execute.bat?
What error code do you get?
And what comes th linux, I'm not sure... you'll need a shell interpreter there too, me thinks. (never had to run anything with runtime.exec on linux). Check the man pages if csh, bash, ksh, or what ever shell you like. -
How to send HTML mail with images multipart/related message
Hi,
Could any body tell me how to send HTML mail with images in "multipart/related" message,if any body can give the code ,it would be helpful.
ThanksHi,
Could any body tell me how to send HTML mail with
ith images in "multipart/related" message,if any body
can give the code ,it would be helpful.
ThanksHi!
Refer to
http://developer.java.sun.com/developer/onlineTraining/JavaMail/index.html
I've found it very helpful.
Look at the last part for a code showing how to send HTML mail!
Regards -
I developed a system where users can login and check for updated information and documents. But the changes are made once or twice in a year. I want to send email after changing the documents. I stored email addresses in the DB. Now the question is how to send e-mails to concerned users without using external software (Outlook, etc.). [Considering same subject and message for all e-mails.]
Go to Java Mail forum:
http://forum.java.sun.com/forum.jsp?forum=43 -
How to send a mail on a particular date
hello everybody.
i am developing a greeting site.
where in i need to send a mail on a particular date, which is greater than today. how can i send mail on a pre selected date.
my server is IIS and i am using java servlets and java mail api.
please tell me if anybody having the solution.
or please mail me to [email protected]
thank you
sambareddy
hyderabadAs far as I know there is no method in JavaMail for sending a message on a particular date.
However you can use the Java.util.Timer and java.util.TimerTask class to do this.
In the class that you send your message from
public class SendMessage extends TimerTask{
public void run(){
//send message here
TimerTask implements Runnable so a thread can be created here.
To call the thread:
public class CallMessage{
public static void mail(String args[]){
SendMessage sm = new SendMessage();
Timer timer = new Timer();
timer.schedule(sm, 10000, 10000)
//wait for 10 seconds and repeat in 10 seconds
There are a number of different schedule methods available for whatever you need to do.
Hope this helps! -
How to tag spam mails in iron port and foreword to junk folder?
How to tag spam mails in iron port and foreword to junk folder?
As Dave has suggested.
Positively identified spam recommended actions would be to Drop it -- if you would like to review these emails and manually remove it, then send it to the spam quarantine
This can be changed under the GUI > Mail Policies > Click on Incoming or Outgoing mail Policies and edit the anti-spam settings per policy if needed.
Ideally suspected spam to be sent to the quarantine for further review.
If you do not wish to use a quarantine or drop the email, you can prepend the email as Dave also suggested and send it to the end recipient under [Suspected Spam] <Subject> for the end user to determine it.
However the IronPort will not make specific rules to deliver it to the MUA's Junk mail folder.
This type of setup is normally down to each specific end user to work with on their own MUA (outlook, lotus, safari etc.)
I hope this helps.
Regards,
Matthew Huynh -
Hi,
I feel silly- but I know someone out there knows this in a New Yors second!
I have a MacBook Pro - everything the latest. With "MAIL" - it used to be when I receive an email - the little icon in the dock bounced, along with the sound effect.
I zereoed my HD - reinstalled everything fresh - and now . . . NO bouncing icon.
I was kinda getting to like him, bouncing around excitedly - I feel like I've lost an old friend!
Anybody know how to get it to bounce when new emails arrive? Everything else, is fine. Is there a preference somewhere?
Thanks,
LarryHi Ferd,
Thank you for your response. It seems you are EXACTLY CORRECT! I hae a friend who works for Apple - if you're curious, he said this . . .
"Add a rule in your Mail preferences that can either be global for all new email or for specific emails. You can have it ignore the unimportant ones. The rule can be: if new mail received, then bounce mail icon in dock. As for sound that should just be the General preference for New Mail. You choose which system sound to use. Sometimes system sounds get funky, especially when using other sound sources sound editing/hacking software. This causes all system sounds to stop. You may notice trash not emptying or iChat not being audible for incoming/outgoing messages. To fix this, you need to open Activity Monitor app and force quit the coreaudio process. It'll auto relaunch and your sounds should be back.
Hope this helps,
M"
And this basically completely agrees with you! Thanks again - problem solved!
Larry
Maybe you are looking for
-
ITunes error message? windows vista..
i've never had any problems with my iPod and iTunes...but now for some reason whenever I plug my iPod in it won't sync to iTunes and this error message comes up: "iTunes could not connect to the iPhone "iPod" because of an unknown error (0xE800006B)"
-
Report to view Production order wise atcual cost when PO is assigned to PCC
Hi All, Can anyone help me to get the report for production order wise actual cost incurred when that Production order is assigned to PCC (Product cost collector). Is it possible through Summarization hierarchy or Product drilldown? If yes, can u exp
-
What is the best way to port a entire website?
I need to elevate my test site to the production site... Can anyone tell me if there is an "easy way to just copy the site from one remote ftp to another ftp w/ dreamweaver? This would include any subdirectories, jquery, images, PHP, etc... at one t
-
Digital personnel file configuration
Dear experts, First of all... Wishing a very happy new year. I am new to HCM and Digital personnel files. Now actually I need to configure digital personnel file for HR personnel records, I had small experience in SAP Records management. I did some
-
SQL Query to gather Team Discussion Notes
Can someone assist with some help in writing or even finding the correct data from Project Server. This is in regards to the Team Discussion notes for each project. I would like a query that I can run that gathers the author, date, and the note(s) fr