Automatic Mail Sending in Java/JSP/Servlets
Hi,
How to send mails with a specified format automatically after a stipulated no of days when the user does not access a file/page.
TIA
1. In your web application, have a database that keeps track of when a user accesses a page.
2. Once a day, run a program that scans that database looking for cases when a user has not accessed a page for N days, or whatever your criterion is. Use JavaMail to send an e-mail message to each of those users.
If you have specific questions about any of these things, don't hesitate to ask them in the appropriate forum.
Similar Messages
-
Hi All,
Basically I need to remove the automatic mail sending feature in the IDOC, please give me the solution, whether it is standard functionality, or is there any user exit to avoid.
If it is a Standard functionality then mention the Std. Program name or
If it is from userexit then plz mention the Exit name.
Thanks In Advance.think u need to check tcode swu3 for automatic workflow customizing and check in we40 (error AND STATUS PROCESSING) whether the processing code is assigned to the workflow task.
if it is assigned,the workflow will be automatically triggered and the mail will be sent to the user by itself.
ALE error handling uses workflow. A standard task is provided for each message type. Task TS20000051 is used for all BAPIs.
Workflow functions as follows:
A task (work item) is generated for the error handling and stored as a message in the inboxes of the employees responsible.
If one of these employees processes the work item, the standard task method for error handling is started. The user can, for example, restart IDoc processing.
If the IDoc is processed successfully, the work item is deleted from the inboxes of all the employees involved.
For this procedure to function, the employees responsible for a particular message type and partner (sender or receiver) must be defined as follows:
1. A hierarchy of organizational units (for example, "sales office") and positions (for example, "customer officer for customer X") is created and employees are assigned to it.
2. The standard tasks for error handling (for example, an error related to an inbound sales order) are assigned to the relevant organizational units or positions (for example, "sales office").
3. The organizational unit, position or employee responsible for dealing with the error are specified for each partner and message type in the partner profiles.
If an error occurs, the system determines:
1. The employees responsible using the staffing schedule of the organizational unit or position linked to the standard task.
2. The employees defined in the partner profiles (using position, user ID, or organizational unit).
3. The employees appearing in both groups represent those who will receive a work item in their inboxes.
Please give me reward point If it is useful
Thanks
Murali Poli -
Hi all,
Now I want to use Java (JSP, Bean, Servlet and EJB) for programming (application/web/internet/database). Which architects I should use?
JSP --> Database.
JSP --> Beans --> Database.
Servlet --> Database.
JSP & Servlet --> Database
JSP & EJB --> Database...
Can I use COM/DCOM such as ASP pages?
And which databases (SQL Server, Oracle, Access, DB...) I should use? Which web servers (Jrun, JWS, Apache, JWS, Orion...)?
Are there some stuff on Internet relate to this topic (some samples)?
Thanks so much.Hi all,
Now I want to use Java (JSP, Bean, Servlet and EJB)
for programming (application/web/internet/database).
Which architects I should use?you can use the Model-View-Controller or MVC model.
Model = JavaBeans --> for your business logic/process
View = JSP --> for your presentation like HTML
Controller = Servlet --> as your router or dispatcher of the JSPs.
And which databases (SQL Server, Oracle, Access,
DB...) I should use? for large business applications that would require security, optimization, etc., i suggest that you go for a good dbase and i'm referring to Oracle, SQL Server, Sybase, Informix, and the likes. But, if you're going to do simple application, MS Access can do the job. Since it comes with MS Office installation, you'll not find it any harder to configure your dbase.
Which web servers (Jrun, JWS, Apache, JWS, Orion...)?you can use the following apache, IIS, Websphere, etc...
don't forget that you also need an application server. say, tomcat application server and apache web server. -
Conversion of Vedio file to FLV using Java/JSP/Servlets/Struts
Hi all,
This is N.Sridhar and I am working on file transcoding.Does any one have any idea about video conversion tools/API which can be used to programitically with JSP/Servlets/Struts or Java to convert any video file to FLV so that it can be viewed in the Web Browser.Kindly let me know if any one of u have worked on it.You can also get me at [email protected]
Thank you all
Sridhar.NHi all,
This is N.Sridhar and I am working on file transcoding.Does any one have any idea about video conversion tools/API which can be used to programitically with JSP/Servlets/Struts or Java to convert any video file to FLV so that it can be viewed in the Web Browser.Kindly let me know if any one of u have worked on it.You can also get me at [email protected].
Thank you all
Sridhar.N -
Plz help : "AUTOMATIC" Mail sending
Hey Friends
Please see the word "automatic", as soon as user enters a good receipt in MB01 or MIGO, an automatic mail should be send to [email protected] stating:
Material # XXXX quantity XXX has been received into Plant XXXX (field WERKS) Storage Location XXXX (field LGORT) and the date received in.
Please tell me how to do this as automatic.
i have found that data is stored in the MSEG table, but how to use it so that and automatic mail is send.
ThanksHi,
To send an email please use this sample code:
* Declarations.
PARAMETERS: p_email(50) LOWER CASE.
DATA: document_data LIKE sodocchgi1.
DATA: t_content LIKE STANDARD TABLE OF solisti1.
DATA: s_content LIKE solisti1.
DATA: t_receivers LIKE STANDARD TABLE OF somlreci1.
DATA: s_receivers LIKE somlreci1.
START-OF-SELECTION.
* Receivers.
s_receivers-receiver = p_email.
s_receivers-rec_type = 'U'.
s_receivers-express = 'X'.
APPEND s_receivers TO t_receivers.
* Subject
document_data-obj_descr = 'New mail from Sap'.
* Body
s_content = 'Hi,'.
APPEND s_content TO t_content.
CLEAR: s_content.
APPEND s_content TO t_content.
s_content = 'Test email from sap, please don''t reply to this email'.
APPEND s_content TO t_content.
CLEAR: s_content.
APPEND s_content TO t_content.
s_content = 'Thanks,'.
APPEND s_content TO t_content.
s_content = 'Naren.'.
APPEND s_content TO t_content.
* Send the email.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = document_data
TABLES
object_content = t_content
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE e208(00) WITH 'Error in sending email :-(('.
ELSE.
MESSAGE s208(00) WITH 'Email sent :-))'.
ENDIF.
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
In order to do it automaticly either:
- create program which will read a table and look for new entries and schedule it SM36
- use workflow (configure event handling)
Regards,
Wojciech -
Doubts in mail sending in java
Hi,
I am currently using the java mail api to send mails. The program is run in Unix server. I just want to know if routing is possible. Like, currently I have a program that I am running in a unix server A to send mail through a host H. Is there a way in java, where in from server A instead of sending to the actual target through host H, I want to send to unix server B, which will receive this information and send it to target through host H.
Please guide me.
Thanks in advance.JavaMail doesn't control this at all.
Internet email is a "store and forward" protocol. You send the message to a mail server.
It's the responsibility of that mail server to route the message to the ultimate mail server, or at
least get it closer. How the mail servers do that is not your concern, and not something you
can control.
You can see the results of this routing in the "Received" headers in a message. -
Automatic mail sending at good receipt
Hello friends
When a goods receipt against a PO (movement type 101) is done into any plant , an e-mail should be sent to [email protected] stating:
Material # XXXX quantity XXX has been received into Plant XXXX (field WERKS) Storage Location XXXX (field LGORT) and the date received in.
Plz suggest how to do this.
what are the tables that can be used
wat are the fms that can be used etc
where this can be configuered,, or done thru ABAPHi,
1.create an enhancement project using enhancement number:MBCF0005..
in CMOD and in the below fuction module exit you can add you logic to send the mail.
<b>EXIT_SAPM07DR_001.</b> in INCLUDE ZXMBCU05 .
2.you can get all the required data in the MSEG table.
3. you can use the following fuction module to send the email.
'SO_NEW_DOCUMENT_ATT_SEND_API1'
below is the sample code..
REPORT ZPAVAN_EXAMPLE.
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
OBJHEAD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
OBJBINLIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
OBJTXTLIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
RECLISTLIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
DOC_CHNGLIKE SODOCCHGI1,
TAB_LINES LIKE SY-TABIX.
PARAMETER P_EADDR LIKE RECLIST-RECEIVER. "EXTERNAL E-MAIL ADDRESS
DOC_CHNG-OBJ_NAME = 'SENDFILE'.
DOC_CHNG-OBJ_DESCR = 'SEND EXTERNAL MAIL'.
OBJTXT = 'LINE 1 OF MESSAGE'.
APPEND OBJTXT.
OBJTXT = 'LINE 2 OF MESSAGE'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
RECLIST-RECEIVER = P_EADDR.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 3
OTHERS = 4.
IF SY-SUBRC EQ 0.
WRITE:/ 'E-MAIL MESSAGE SENT TO', P_EADDR.
ELSE.
WRITE:/ 'COULD NOT SEND E-MAIL TO', P_EADDR.
ENDIF.
thanks and Regards,
Pavankumar -
Automatic mail sending freezes outlook 2013
I have a brand new laptop with fresh installation of Office Home and Business 2013, and there is a problem i can't wrap my head around it.
User takes his laptop home, writes 10+ mails and sends them, they lay down in outbox till tomorrow, where he comes to work, connects to network and then problems start to arise.
Mails and attachments never exceed more than 1 or 2 mb's and its usually one at that size...
Problem; user connects laptop to network and Outlook freezes for 15-30 minutes, later on unfreezes and mails are sent (it is sending them in freezed period), after that everything works just fine..
I have reinstalled office, removed profile, checked for plugins there are none, problem still not resolved.
Anyone has any idea?So no one has any idea, or maybe i used bad english, if so please ask i will clarify if missed something
-
Automatic mail shoot from java
hell every body,
hope this topic will draw ur kind attention.
i have a database in sql server200.
when our client lodged a complaint, i want an automated mail should forwarded to his personal Email ID
Can any body send some sample Code
AwaitingThe JavaMail API. But don't do it. Get humans responding.
-
ABAP Query Automatic mail send
Dear ABAP Gurus,
Is it possible for a query to build/fix a printer to a query? When you run the query , it should send the layout to the person who run it in PDF format. How can it be done without any abap code?
many thanks
John BlackHi Prashantroy
You can change the text of the notification e-mails as described in "Changing the Texts of Notification E-Mails".
Refer to [Notification by E-Mail |http://help.sap.com/saphelp_nw04/helpdata/en/89/c5fd430b63c74bbdfaa5f2ec9bb20b/content.htm]
Hope it will helps
Best Regards
Arun Jaiswal -
Automatic mail sending for goods receipt
Hello friends
When a goods receipt against a PO (movement type 101) is done into any plant , an e-mail should be sent to [email protected] stating:
Material # XXXX quantity XXX has been received into Plant XXXX (field WERKS) Storage Location XXXX (field LGORT) and the date received in.
Plz suggest how to do this.
what are the tables that can be used
wat are the fms that can be used etc
where this can be configuered,, or done thru ABAPsolved self. scheduled a backgound job. as no user exit and badi is available
-
Configuration need automatic mail to others users
hi friends
we have the requirement like if user change the price in the condition record ,automatically mail send to the user. then only user
update in the sale order.
note : purpose to losing the revenue of the company
with reagrds
dinesh
Edited by: code acess on Apr 8, 2011 8:08 AMHope the following SDN thread can assist you:
- Mail trigger from VK11
Thanks & Regards
JP -
Help me with mail sending with servlets/jsp
: doe any one have a clue as to how to send a mail via jsp/servlets.
An obvious solution is to use JavaMail. It is part of j2EE.
-
hi all,
Can any one help me, how can i send the mail from JSP-Servlet.
in Spring, we have a the following package to send mail,
import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
Suggest me to solve the problem.
Thanx in advance.
BalaHi balu,
i already go thru that API. My problem is if i add any additional jar file for sending the mail from JSP or Servlets only. not in high technology.
i mention spring as an example.
so, kindly suggets me on that.
Bala -
How can Send Email From JSP to all Mail server.it gives error
I try this code in netbean 5.But it will give the Error.
The code:
<%@page import="java.util.*"%>
<%@page import="javax.mail.*"%>
<%@page import="javax.mail.internet.*"%>
<%
Properties props = System.getProperties();
props.put("mail.smtp.host", "smtp.gmail.com" );
props.put("mail.smtp.port", "465" );
Session s = Session.getInstance(props, null);
MimeMessage message = new MimeMessage(s);
String From = request.getParameter("sender");
InternetAddress from = new InternetAddress(From);
message.setFrom(from);
String Tos = request.getParameter("reciever");
InternetAddress to = new InternetAddress(Tos);
message.addRecipient(Message.RecipientType.TO, to);
String sub =request.getParameter("subject");
message.setSubject(sub);
String mgs =request.getParameter("message");
message.setText(mgs);
Transport.send(message);
%>
<html>
<p align="center">
A Message has been sent. <br>
Check your inbox.
</p>
<p align="center">
Click here to send another!
</p>
</html>
Error is :
javax.servlet.ServletException: Could not connect to SMTP host: smtp.gmail.com, port: 465
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.MailBeema_jsp._jspService(MailBeema_jsp.java:88)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
root cause
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
nested exception is:
java.net.ConnectException: Connection timed out: connect
com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
javax.mail.Service.connect(Service.java:275)
javax.mail.Service.connect(Service.java:156)
javax.mail.Service.connect(Service.java:105)
javax.mail.Transport.send0(Transport.java:168)
javax.mail.Transport.send(Transport.java:98)
org.apache.jsp.MailBeema_jsp._jspService(MailBeema_jsp.java:68)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
nested exception is:
java.net.ConnectException: Connection timed out: connectFairly self-explaining, isn't it? That host cannot be connected.
Either check the correctness of the hostname/port, or check your network settings (firewall, router, etc).
Maybe you are looking for
-
I have read a number of reports of the problems people were having with acrobat 7 pro and vista so I thought I would report how I got it to work for me. My hardware is a new notebook running Vista Home Premium SP1 with all current updates. After inst
-
My Ipod nano touch is not charging, not showing in my PC or laptop. Last I saw an apple icon and low battery signal. There after the screen is black and no power not taking AC or PC charge. What Can I do?
-
Bluetooth Keyboard malfunction
Some of the keys in the bluetooth keyboard are not function normally. The "delete" is used to be function as a backspace key. Now this key can only delete the character in front of the cursor and not function as backspace key anymore. Also the arrow
-
Calling one java program (with main method) from another
Hello, How can I start another java program from one? Lets say I want Second.java to start by calling it from First.java. How do I do it? The two programs are given below. Any help is appreciated. Thanks, Amanda First.java import java.io.*; import ja
-
Error in creating ThemeBasedFOI with SELECT
when I try to create one WAS with following select: "SELECT * FROM TABLE WHERE COLUMN > 176" occurs the following error of xml: "Cannot process the followinng response from FOI server: <?xml version="1.0" encoding="UTF-8"> <oms_error>[Foi Server] foi