Help needed for sending email
Hi,
I need to send one mail to sales order representative. I have mail Id.
I am using FM "SO_NEW_DOCUMENT_SEND_API1".
In email in subject line I need to write 'Sales order' & in body I need to write "Sales order created'.
Anybody will suggest me in which parameters I need to pass the above mentioned value so that I can get appropriate mail??
HI NEHA,
Here is the sample one.
*Internal table to get vendor name and address number
DATA : BEGIN OF it_vname OCCURS 0,
name1 LIKE lfa1-name1,
adrnr LIKE lfa1-adrnr,
END OF it_vname.
*Internal table to get email_if with address number
DATA : BEGIN OF it_vemail OCCURS 0,
email LIKE adr6-smtp_addr,
END OF it_vemail.
*Emiail subject
DATA : psubject(40) TYPE c .
*Data declaration for mail FM
DATA: it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
it_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
it_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_cnt TYPE i,
gd_sent_all(1) TYPE c,
gd_doc_data LIKE sodocchgi1,
gd_error TYPE sy-subrc.
*Internal table for message body
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE,
it_messagewa LIKE LINE OF it_message .
<b>psubject = 'PO Regarding'.</b>
*Accessing name and address number of a vendor
SELECT SINGLE name1 adrnr FROM lfa1 INTO it_vname WHERE lifnr EQ i_ekko-lifnr.
*Accessing mail id of a vendor
SELECT SINGLE smtp_addr FROM adr6 INTO it_vemail WHERE addrnumber EQ it_vname-adrnr.
* Mail Text
CLEAR it_message.
REFRESH it_message.
<b>CONCATENATE 'Dear' it_vname-name1 ',' INTO it_messagewa SEPARATED BY space.
APPEND it_messagewa TO it_message.
APPEND 'Please issue the items for the following PO Number .' TO it_message.
CLEAR it_messagewa.
CONCATENATE 'PO NUmber : ' i_ekko-ebeln INTO it_messagewa</b> SEPARATED BY space.
APPEND it_messagewa TO it_message.
APPEND 'you can view it at www' TO it_message. APPEND 'Regards,' TO it_message.
APPEND 'TEST.' TO it_message.
* Fill the document data.
gd_doc_data-doc_size = 1.
* Populate the subject/generic message attributes
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
gd_doc_data-obj_descr = psubject.
gd_doc_data-sensitivty = 'F'.
* Describe the body of the message
CLEAR it_packing_list.
REFRESH it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES it_packing_list-body_num.
it_packing_list-doc_type = 'RAW'.
APPEND it_packing_list.
* Add the recipients email address
CLEAR it_receivers.
REFRESH it_receivers.
it_receivers-receiver = it_vemail-email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = 'X'.
it_receivers-notif_ndel = 'X'.
APPEND it_receivers.
* Call the FM to post the message to SAPMAIL
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gd_doc_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = gd_sent_all
* NEW_OBJECT_ID =
TABLES
packing_list = it_packing_list
* OBJECT_HEADER =
* CONTENTS_BIN =
contents_txt = it_message
* CONTENTS_HEX =
* OBJECT_PARA =
* OBJECT_PARB =
receivers = it_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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Store function module return code
gd_error = sy-subrc.
* Get it_receivers return code
LOOP AT it_receivers.
ENDLOOP.
ENDIF.
Regards,
Madhu.
Similar Messages
-
Help: application for sending email in jre 1.3
Hi,
I have a task to write a program that would run on a machine that has jre 1.3. The program is supposed to send email notifications on certain events. I've been looking for examples on the net to point me to the right direction and i'm still looking. Could anyone help me? Thanks.Use JavaMail to send mail.
http://java.sun.com/products/javamail/FAQ.html -
Hi Friends,
I am Ravi Maheshwari from India. I am working on a project where we have to take the feedback from the customer/visitors. For that i have design the feedback from and where i have specified our server mail address where that feedback should come.
But when I click on send feedback button it opens the MS-Outlook with all the information and ask to send the mail, it is not sending it directly. so what should i do so it will send the mail directly.
Please help me as This page will go live so early.
Thanks in advance.
Regards
Ravi MaheshwariWell, I guess you will need to provide some script or servlet you can send the HTTP form request to, that then composes an e-mail, connects to a mail server and sends it...
If all you know is HTML, you'll have a huge lot to learn. -
Password Needed For Sending Emails - EVERYTIME
All of a sudden, every time I try to send an email from Apple Mail, using my iCloud account, I get a pop-up asking me to enter my system administrator password. Someone please help me figure this out before I throw this computer out the window. I am beyond frustrated right now.
<Edited by Host>Back up all data before proceeding.
Launch the Keychain Access application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad and start typing the name.
Select the login keychain from the list on the left side of the Keychain Access window. If your default keychain has a different name, select that.
If the lock icon in the top left corner of the window shows that the keychain is locked, click to unlock it. You'll be prompted for the keychain password, which is the same as your login password, unless you've changed it.
Right-click or control-click the login entry in the list. From the menu that pops up, select
Change Settings for Keychain "login"
In the sheet that opens, uncheck both boxes, if not already unchecked.
From the menu bar, select
Keychain Access ▹ Preferences... ▹ First Aid
There are four checkboxes in the window that opens. Check all of them. if they're not already checked. Close the window.
Select
Keychain Access ▹ Keychain First Aid
from the menu bar and repair the keychain. Quit Keychain Access.
If you use iCloud Keychain, open the iCloud preference pane and uncheck the Keychain box. You'll be prompted to delete the local iCloud keychain. Confirm. Then re-check the box. Follow one of the procedures described in this support article to set up iCloud Keychain on an additional device. -
Help need for sending object over TCP Connection
I have
ResultSet rs = (ResultSet)connection.getObject(1)
and i have user's connection connected on a port
Currently i am reading while rs.next elements , preparing somestring and i am using socket_connection.send('to_myuser',somestring) to send message
and user receive it like (while input_stream.readLine() != null )
etc .etc.. i am just writing some algorithm which very common.
i want to reduce this recursion on the my server end and once user receive it , and to get all result set retrieved from that end.
my question is , is it possible to send
connection.send('myuser',rs);
and how to read on the other end.
Thanks in advanceJust want to clarify how we can cache it..? I belive
we have to put data somewher in the ArrayList or
something ....which one major taskOf course caching requires that you store it in something.
>
second, you need a very good algorighm to query all
your collections ... i think oracle SQL mechanism is
very nice.... however in your recommended approach i
have to write lots of searching and sorting
alrogrthm... .correct?Generally no. Requests are usually limited to very few parameters and often limited only to one or zero. Thus a user first gets a list of customer names (no parameters for query) and then request the detail about a specific customer (using the customer id which is only one parameter.)
Note that you mentioned large amounts of data. You didn't specify what large meant. However large requests should never be allowed from users (people). They can't use it anyways. Automated processes should be architected to provide for a technological solution with is cost effective. -
[Request For Help] How To Send Email Midlet Using Secure Socket ?
Hello, this is the first time i ask for help to forum.sun.com.
i try to make secure connection for send email from MIDlet. Maybe you can check to my code :
EmailMidlet.java
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.;
public class EmailMidlet extends MIDlet implements CommandListener{
Display display = null;
// email form fields
TextField toField = null;
TextField subjectField = null;
TextField msgField = null;
Form form;
static final Command sendCommand = new Command("send", Command.OK, 2);
static final Command clearCommand = new Command("clear", Command.STOP, 3);
String to;
String subject;
String msg;
public EmailMidlet() {
display = Display.getDisplay(this);
form = new Form("Compose Message");
toField = new TextField("To:", "", 50, TextField.EMAILADDR);
subjectField = new TextField("Subject:", "", 15, TextField.ANY);
msgField = new TextField("MsgBody:", "", 90, TextField.ANY);
public void startApp() throws MIDletStateChangeException {
form.append(toField);
form.append(subjectField);
form.append(msgField);
form.addCommand(clearCommand);
form.addCommand(sendCommand);
form.setCommandListener(this);
display.setCurrent(form);
public void pauseApp() {
public void destroyApp(boolean unconditional) {
notifyDestroyed();
public void commandAction(Command c, Displayable d) {
String label = c.getLabel();
if(label.equals("clear")) {
destroyApp(true);
} else if (label.equals("send")) {
to = toField.getString();
subject = subjectField.getString();
msg = msgField.getString();
EmailClient client = new EmailClient(this,"[email protected]", to, subject, msg);
client.start();
}and EmailClient.java
import javax.microedition.io.;
import javax.microedition.lcdui.;
import java.io.;
import java.util.Date;
public class EmailClient implements Runnable {
private EmailMidlet parent;
private Display display;
private Form f;
private StringItem si;
private SecureConnection sc; //SSL
private InputStream is;
private OutputStream os;
private String smtpServerAddress = "smtp.gmail.com"; //SSL
String from;
String to;
String subject;
String msg;
public EmailClient(EmailMidlet m, String from, String to, String subject, String msg) {
parent = m;
this.from = from;
this.to = to;
this.subject = subject;
this.msg = msg;
display = Display.getDisplay(parent);
f = new Form("Email Client");
si = new StringItem("Response:" , " ");
f.append(si);
display.setCurrent(f);
public void start() {
Thread t = new Thread(this);
t.start();
public void run() {
try {
//SSL
sc = (SecureConnection)
Connector.open("ssl://"smtpServerAddress":465"); //smtp with SSL port 465
sc.setSocketOption(SocketConnection.LINGER, 5);
is = sc.openInputStream();
os = sc.openOutputStream();
os.write(("HELO there" "\r\n").getBytes());
os.write(("EHLO" "\r\n").getBytes());
os.write(("auth login" "\r\n").getBytes());
os.write(("dHVnYXNha2hpci50cmlhZGl0eWFAZ21haWwuY29t" "\r\n").getBytes());
os.write(("dGEuZW1haWxjbGllbnQ=" "\r\n").getBytes());
os.write(("MAIL FROM:<">\r\n").getBytes());
os.write(("RCPT TO:<">\r\n").getBytes());
os.write("DATA\r\n".getBytes());
// stamp the msg with date
os.write(("Date: " new Date() "\r\n").getBytes());
os.write(("From: "+from"\r\n").getBytes());
os.write(("To: "to"\r\n").getBytes());
os.write(("Subject: "subject"\r\n").getBytes());
os.write((msg+"\r\n").getBytes()); // message body
os.write(".\r\n".getBytes());
os.write("QUIT\r\n".getBytes());
StringBuffer sb = new StringBuffer();
int ch = 0;
while((ch = is.read()) != -1) {
sb.append((char) ch);
si.setText("SMTP server response - " + sb.toString());
} catch(IOException e) {
e.printStackTrace();
Alert a = new Alert
("TimeClient", "Cannot connect to SMTP server. Ping the server to make sure it is running...", null, AlertType.ERROR);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
} finally {
try {
if(is != null) {
is.close();
if(os != null) {
os.close();
if(sc != null) {
sc.close();
} catch(IOException e) {
e.printStackTrace();
public void commandAction(Command c, Displayable s) {
if (c == Alert.DISMISS_COMMAND) {
parent.notifyDestroyed();
parent.destroyApp(true);
} When I try to debug project from netbeans, i found this error :
Starting emulator in debug server mode on port 2668
Connecting to 127.0.0.1 on port 2800
nbdebug:
Waiting for debugger on port 2668
Waiting for KVM...
Running with storage root temp.SonyEricsson_JP8_128x160_Emu10
KdpDebugTask connecting to debugger 1 ..
Running with locale: Indonesian_Indonesia.1252
Connected to KVM
Connection received.
Attached JPDA debugger to localhost:2668
java.io.IOException: error 10054 during TCP read +
at com.sun.midp.io.j2me.socket.Protocol.nonBufferedRead(Protocol.java:299)+
at com.sun.midp.io.BufferedConnectionAdapter.readBytes(BufferedConnectionAdapter.java:99)+
at com.sun.midp.io.BaseInputStream.read(ConnectionBaseAdapter.java:582)+
at com.sun.midp.ssl.Record.rdRec(+41)+
at com.sun.midp.ssl.Record.rdRec(+5)+
at com.sun.midp.ssl.In.refill(+18)+
at com.sun.midp.ssl.In.read(+29)+
at EmailClient.run(EmailClient.java:74)+
Execution completed.
5145824 bytecodes executed
9258 thread switches
1762 classes in the system (including system classes)
0 dynamic objects allocated (0 bytes)
0 garbage collections (0 bytes collected)
debug:
BUILD SUCCESSFUL (total time: 4 minutes 34 seconds)
Regard
LittlebroDon't multipost and don't use the browser's back button to edit your posts as that creates multiple postings. I've removed the other thread you started with the same questio.
Also, don't post to long dead threads. I've blocked your post and locked the thread you resurrected.
db -
Function module for sending email
Hi all,
Can I know list of function modules for sending emails.
Other than "SO_DOCUMENT_SEND_API1"
pls let me knowHi Praveen,
Below is the sample code to send the external mail.
&**********Reward Points if helpful**********&
DATA: ld_mtitle LIKE sodocchgi1-obj_descr,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des .
ld_receiver LIKE sy-subrc.
DATA: it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
it_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c, "#EC NEEDED
w_doc_data LIKE sodocchgi1.
REFRESH it_receivers . CLEAR it_receivers .
IF v_trip_send = 'X'.
it_receivers-receiver = it_trip_dload-approver_email .
ELSE .
it_receivers-receiver = it_adv_dload-approver_email .
ENDIF.
it_receivers-rec_type = c_u .
APPEND it_receivers. CLEAR it_receivers.
it_receivers-receiver = " ------> pass your reciever email id.
IF v_trip_send = 'X' .
it_receivers-receiver = it_trip_dload-requester_email .
ELSE .
it_receivers-receiver = it_adv_dload-requester_email .
ENDIF .
it_receivers-rec_type = c_u .
it_receivers-copy = 'X' .
APPEND it_receivers. CLEAR it_receivers.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = c_saprpt.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = c_saprpt.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = c_f.
CLEAR it_attachment.
REFRESH it_attachment.
it_attachment[] = it_attach[].
Describe the body of the message
CLEAR it_packing_list.
REFRESH it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES it_packing_list-body_num.
it_packing_list-doc_type = c_raw.
APPEND it_packing_list.
Create attachment notification
it_packing_list-transf_bin = c_x.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
DESCRIBE TABLE it_attachment LINES it_packing_list-body_num.
it_packing_list-doc_type = ld_format.
it_packing_list-obj_descr = ld_attdescription.
it_packing_list-obj_name = ld_attfilename.
it_packing_list-doc_size = it_packing_list-body_num * 255.
APPEND it_packing_list.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = c_x
commit_work = c_x
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = it_packing_list
contents_bin = it_attachment
contents_txt = it_message
receivers = it_receivers. -
Are socket needed to send emails?????
hi guys,
lets say i need to send an email notification everytime i finish doing a cetain task....do i need to create and use a socket to send these emails????
thanks in advance for any help...
lost and blur.
Below are the codes to send email:
(So are socket needed???)
public void execute(String mailto, String mailcc, String mailsub, String mailbody){
//session object inside the catch block also(in case of DCOException).
DCOSession ds = null;
try{
ds = new DCOSession(); // Create new DCOSession object
ds.login("erstest02"); // Log in as current Notes client user
DCOMail dm = new DCOMail(); // Create new DCOMail object
dm.setDcoSession(ds);// Pass DCOSession to mail
//dm.setDebug(true);
dm.setSendTo(mailto);
dm.setCopyTo(mailcc);
//dm.setBlindCopyTo();
dm.setSubject(mailsub);
dm.setBody(mailbody);
//System.out.println("before mail sent");
dm.send(); // Send the mail
ds.logout(); // Log out of the session
System.out.println("mail sent to "+mailto);
}catch(DCOException e1){
e1.printStackTrace();
try{
if(ds!=null){
ds.logout(); //Log out of session even if exception is thrown
}catch(Exception ee1){
System.out.println("Exception thrown while trying to logout of session");
ee1.printStackTrace();
}catch(Exception e){
e.printStackTrace();
try{
if(ds!=null){
ds.logout(); //Log out of session even if exception is thrown
}catch(Exception ee2){
System.out.println("Exception thrown while trying to logout of session");
ee2.printStackTrace();
}lets say i need to send an email notification
everytime i finish doing a cetain task....do i need
to create and use a socket to send these emails????Yes, sockets are needed to send emails. However, you don't need to deal with them yourself. You can use the JavaMail API. It will hide those low level details from you and let you deal with concepts that are related to sending emails--addresses, contents, servers, etc.
http://java.sun.com/developer/onlineTraining/JavaMail/ -
SAPCONNECT guide for sending Emails from BW System to Individual Email IDs
Hello Everybody,
If somebody can send me a pdf guide for SAPCONNECT inorder to configure Information Broadcasting in SAP BW for sending Emails to user's mail Id from BW system i will reward points to the helper for same if the help found useful as iam struggling for a pdf guide since long but couldnot find one ,not even over google,i dont need help site links ,i have tried them already ,they dont lay the exact procedure ,but a pdf guide ,my email id is [email protected] .
Regards,
SaumyaHello Vikash,
Plz check i have rewarded you points for this forum under very helpful answers.Kindly now plz help me with this matter:
I got ur document ,it was very helpful.Actually though i have already done most of these steps but i did all these steps all over again.Have u already made configuration for BW Information Broadcasting on your side because although i have done all these steps but wt happens is that the mails get collected in the SOST transaction and iam still not able to send mails and the error displayed is as :
Message cannot be transferred to node SMTP due to Connection Error .
Kindly please revert back to this error at earliest.
Regards,
saumya -
Need to send email with content of total sales
Hi experts,
I have configure notification mailer and have received also test email. Usually I may receive oracle alerts in my email address.
I need two solutions or need to build below mention point.
1) need to send email total daily sale ?
2) need to setup oracle alerts ?
I am waiting your kind response or refer solid documents to fulfil my requirements
ThanksYou can configure an alert that fires every day at about 1:00 am.
The alert can query oe_order_lines_all table for all orders lines that were created in booked status on the prior day.
Then you can format the alert to include the total amount.
You can group by sales person or by warehouse.
If you want to group the sales by item numbers, the email may become long depending on the number of items you sell every day.
See http://docs.oracle.com/cd/A60725_05/html/comnls/us/alr/summary.htm for a great example on how to send a summary alert.
Hope this helps,
Sandeep Gandhi -
Settings on Microsoft Exchange Server for sending Email from BW to emailid
Hello Everybody,
I wanted to know that for sending Email from SAP System (that is via Information broadcasting feature of BW )to Email IDS of individuals do we need to make any configurations on Exchange Server as well or some RFC between Microsoft Exchange Server and BW .I have made all settings for SMTP through SCOT transaction but still not able to send mails.From our Exchange Server,the connector is removed ,do we need to reconnect it for this purpose.kindly please tell me wt all configurations do i need to make on Mail server for sending Emails as iam not able to do the same now.If somebody can send a PDF/Word document in support for the same on my email Id [email protected] ,i shall be highly obliged.Your help shall be appreciated ,kindly revert at earliest.
Regards,
saumyaHi Somya,
Looks like you are deep into Information Broadcasting. I am sure you must have seen this, still sharing with you -
SAP Notes -
875136 - Node ID is missing in the status message for RFC connection
455140 - Configuration E-mail, fax, paging/SMS via SMTP
regards
Vikash -
ABAP program for sending emails
Hello SAP developers,
I need ABAP program for sending emails to my internet adress in background - just some simple header with no body and no attachement. Recipient should be specified due the parameter etc... Does program like this exist or i have to create it? I am not familiar with ABAP. I am basis admin so I am little bit lost in this. I have tried program code from this page ->
http://www.sapdevelopment.co.uk/reporting/email/email_mbody.htm
But anyway it does not work - there is an exception "no message send". SCOT is configured, mails are working fine from transaction SBWP.
Thanks in advace
JMI have already solved my issue through CCMS agents and RZ20 central autoreaction (sms) in Solution Manager.
Regards
JM -
Setting default account for sending email
I have 4 accounts I use for sending email, but would like to have one be the default and can't figure how to do that. there is a check box next to the outgoing server dropdown that says use only this account. I don't think that is what I want, nor am i clear what that would do.
Is there a way to set a preferred outgoing account?
Does that require a plug in or helper app of some sort.
thanks for any suggestions.In Mail>Preferences>Composing:
Use Send new messages from: to select an account. -
Servlet for sending email error
i working for send email using servlet and html. when i run i got this error..
what cause this problem.
please someone help me. urgent!!!
thank you in advance
servlet error........
ENCOUNTERED EXCEPTION: java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
at EmailSMSServlet.doPost(EmailSMSServlet.java:123)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)here is my code...actually my program send email from SMS. i parser SMS to email format. My SMS part is working but when i combine it,i got error as above. I tried run without servlet (using command prompt) it working properly and i can send email.
public class EmailSMSServlet extends HttpServlet
CService srv;
int status;
LinkedList msgList;
public void init(ServletConfig config) throws ServletException {
super.init(config);
srv = new CService("com4", 9600);
msgList = new LinkedList();
srv.initialize();
srv.setCacheDir(".\\");
public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException
PrintWriter writer = response.getWriter();
response.setContentType("text/html");
writer.println("<html>");
writer.println("<head>");
writer.println("<title>SMS TO EMAIL</title>");
writer.println("</head>");
writer.println("<body bgcolor=\"blue\">");
writer.println("test");
try
status = srv.connect();
if (status == CService.ERR_OK)
srv.setOperationMode(CService.MODE_PDU);
if(srv.readMessages(msgList,CIncomingMessage.CLASS_ALL)==CService.ERR_OK)
for (int i = 0; i < msgList.size(); i ++)
CIncomingMessage msg =(CIncomingMessage)msgList.get(i);
String s=msg.getText();
String from1=msg.getOriginator()+"@mysite.bla.bla";
writer.println(s);
writer.println("<p>");
writer.println(from1);
writer.println("<p>");
// parser sms to email ...
String delim = "#";
StringTokenizer st= new StringTokenizer(s,delim);
String str[] = new String[st.countTokens()];
int j=0;
while (st.hasMoreTokens())
str[j++] = st.nextToken();
writer.println("<p>");
writer.println("Kepada:");
writer.println(str[0]);
for(int k = 0; k < str.length; k++)
writer.println(str[k]);
// Send mail using javamail.....
Properties props=new Properties();
props.put("mail.transport.default",blah");
props.put("mail.smtp.host","blah");
try{
Properties props=new Properties();
props.put("mail.transport.default","smtp");
props.put("mail.smtp.host","host");
Session mailSession=Session.getInstance(props,null);
Message mssg=new MimeMessage(mailSession);
mssg.setSubject(str[1]);
mssg.setContent(str[2],"text/plain");
Address to =new InternetAddress(str[0]);
mssg.setRecipient(Message.RecipientType.TO,to);
Address from=new InternetAddress(from1);
mssg.setFrom(from);
Transport.send(mssg);
writer.println("Succes");
} catch (Throwable t) {
writer.println("<font color=\"red\">");
writer.println("ENCOUNTERED EXCEPTION: " + t);
writer.println("<pre>");
t.printStackTrace(writer);
writer.println("</pre>");
writer.println("</font>");
srv.disconnect();
else
writer.println("Connection to mobile failed, error: " + status);
catch (Exception e)
e.printStackTrace();
writer.println("<br><br>");
writer.println("</body>");
writer.println("</html>");
thanks -
Using MTA SDK for sending emails
Hi,
After taking a look to the MTA SDK documentation I still have a key question.
My program needs to send emails to an existent SMTP server - Sun Messaging Server - running in a different box. Can I use MTA to send those emails? I read in several places "Callable Send" can be used only for sending messages from local host, so I'm not sure in my case it can be done.
If it's possible, I'd appreciate any sample of how to do it.
Thanks in advance,
Jorge Ortiz ClaverYeah, I know I need to send the message connecting to Sun MTA but I don't know how. Actually, I know I can use a SMTP client but I'd need to use a third-party library (or build it by my own). I can't use mailx or sendmail from my application. I wouldn't have much control over its execution and each mail submit would mean a context change in my application. I need some kind of API for doing it programatically.
My question is: what is the MTA SDK for? I know I can send/receive messages but I can't understand why I can't do it from remote. As far as I can understand, it seems like MTA SDK works directly with the same local resources Sun MTA server is using, right?
Thanks again,
Jorge
Maybe you are looking for
-
How many users can I import at one time?
Is there a limit on how many users I can import at one time? Also, how about other record types (Lead, Opportunity, Contacts ...etc.) Is there a limit on these also? Where in the documentation that I can find info for this please? I'm using CRMOD Rel
-
So my little brother locked my Iphone 5 out, so it said to connect it to my Itunes. So now I connect it to Itunes, however now when I click on restore (That's my only option) it says that "Find my Iphone must be turned off before restore". So I went
-
Video not displaying properly and not exporting.
I'm using Premiere Pro CS4 and After Effects CS4. I brought an AFX composition in via Dynamic Link, made copies of the clip, chopped it up and spliced it back together on one video layer. Within the Premiere Pro interface, the video shows up normal
-
CoreServicesUIAgent would like to access your calendar data
Hi all, three days ago, I received a strange Mavericks pop-up: "CoreServicesUIAgent would like to access your calendar data". Then I went to the Security PrefPane, and saw CoreServicesUIAgent clicked. Strange, so I decided to unclick, although I chec
-
How to play latest video in document library using Media webpart?
Hi, We are trying to play latest video file which is in SharePoint library by using Media webpart. We are adding video files in document library. The top most item or latest item should be played in our page using media webpart. Please let me know if