Problems sending mail with txt attachtment using SO_DOCUMENT_SEND_API1 MF
Hi gurus,
I allready tried to search in the forum some threads related with my problem, but i couldnt found any with the same problem that im having.
My problem it's when attachting an txt file, using MF SO_DOCUMENT_SEND_API1 MF, the mail attachtment it's coming with the txt file but instead of coming with the all lines in the contents_bins table the file it's coming with a few lines. I think the problem it's that the txt file should come with 80 characters per line, like it's on the contents_bin table, buu instead that the MF it's filling me each line of the file with 1024 characters.
Does anyone has ideas what im doing wrong?
Ps - Below goes my code.
Thanks in Advance,
Best Regards,
João Martins.
CLEAR contents_bin.
REFRESH contents_bin.
PERFORM get_attachment TABLES tab_movimentos contents_bin
USING linha_inicial
linha_final.
CLEAR: document_data, tab_lines.
MOVE 'Aviso Ficheiro Retorno' TO document_data-obj_descr.
MOVE 'Aviso Ficheiro de Retorno TU' TO document_data-obj_name.
DESCRIBE TABLE contents_txt LINES tab_lines.
READ TABLE contents_txt INDEX tab_lines.
document_data-doc_size = ( tab_lines - 1 ) * 255
+ STRLEN( contents_txt ).
CLEAR packing_list.
REFRESH packing_list.
packing_list-transf_bin = space.
packing_list-head_start = 1.
packing_list-head_num = 0.
packing_list-body_start = 1.
DESCRIBE TABLE contents_txt LINES packing_list-body_num.
packing_list-doc_type = 'RAW'.
APPEND packing_list.
packing_list-transf_bin = 'X'.
packing_list-head_start = 1.
packing_list-head_num = 1.
ADD 1 TO tab_lines.
packing_list-body_start = tab_lines.
CLEAR: lv_filename, tab_lines.
CONCATENATE 'Fich Retorno -' nome_ficheiro INTO lv_filename.
DESCRIBE TABLE contents_bin LINES tab_lines.
packing_list-doc_type = 'TXT'.
packing_list-obj_descr = 'Ficheiro Retorno'.
packing_list-obj_name = lv_filename.
packing_list-doc_size = tab_lines * 255.
APPEND packing_list.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = document_data
put_in_outbox = 'X'
sender_address = 'SIFJOB'
sender_address_type = 'B'
IMPORTING
sent_to_all = sent_to_all
TABLES
packing_list = packing_list
contents_bin = contents_bin
contents_txt = contents_txt
receivers = tab_receiver
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.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = SPACE
AND RETURN.
FORM get_attachment TABLES p_tab_movimentos STRUCTURE
zlinha_movimentos_fich_retorno
p_contents_bin STRUCTURE contents_bin
USING p_linha_inicial STRUCTURE
zlinha_inicial_ps2
p_linha_final STRUCTURE
zlinha_final_ps2.
DATA: lv_valor(14).
DATA : line(80) TYPE x.
CONCATENATE p_linha_inicial-referencia p_linha_inicial-tipo_registo
p_linha_inicial-tipo_operacao p_linha_inicial-situacao_conta
p_linha_inicial-situacao_registo p_linha_inicial-iban+4(21)
p_linha_inicial-moeda p_linha_inicial-data_pag
p_linha_inicial-ref_ordenante p_linha_inicial-filler
INTO p_contents_bin-line.
CLEAR line.
conv_bin p_contents_bin-line line.
MOVE line TO p_contents_bin-line.
APPEND p_contents_bin.
CLEAR p_contents_bin.
LOOP AT p_tab_movimentos.
CLEAR: lv_valor.
WRITE p_tab_movimentos-montante TO lv_valor.
PERFORM normalize_value USING lv_valor.
CONCATENATE p_tab_movimentos-referencia
p_tab_movimentos-tipo_registo p_tab_movimentos-tipo_operacao
p_tab_movimentos-sit_conta_retor p_tab_movimentos-situacao_registo
p_tab_movimentos-nib lv_valor
p_tab_movimentos-ref_ordenante p_tab_movimentos-filler
INTO p_contents_bin-line.
CLEAR line.
conv_bin p_contents_bin-line line.
MOVE line TO p_contents_bin-line.
APPEND p_contents_bin.
CLEAR p_contents_bin.
ENDLOOP.
CLEAR: lv_valor.
WRITE p_linha_final-mont_total TO lv_valor.
PERFORM normalize_value USING lv_valor.
CONCATENATE p_linha_final-referencia p_linha_final-tipo_registo
p_linha_final-tipo_operacao p_linha_final-filler_1
p_linha_final-situacao_registo p_linha_final-filler_2
p_linha_final-total_reg lv_valor
p_linha_final-filler INTO p_contents_bin-line.
CLEAR line.
conv_bin p_contents_bin-line line.
MOVE line TO p_contents_bin-line.
APPEND p_contents_bin.
CLEAR p_contents_bin.
ENDFORM. " get_attachment
Hi,
I've solved this problem. The problem was because i was using the
* Anexo - Descrição
packing_list-transf_bin = 'X'.
packing_list-head_start = 1. "Here it must be 0 because i wasn't using any table header
packing_list-head_num = 0.
ADD 1 TO tab_lines.
packing_list-body_start = 1.
CLEAR: lv_filename, tab_lines.
CONCATENATE nome_ficheiro 'TB' INTO lv_filename.
* CONCATENATE 'Fich Retorno -' nome_ficheiro INTO lv_filename.
DESCRIBE TABLE contents_bin LINES tab_lines.
packing_list-doc_type = 'TXT'.
packing_list-obj_descr = lv_filename."'Ficheiro Retorno'.
packing_list-obj_name = lv_filename.
packing_list-body_num = tab_lines.
packing_list-doc_size = tab_lines * 255.
APPEND packing_list.
Best Regards
Thanks,
João Martins
Similar Messages
-
Problem sending mail with attachments???
Hi Everybody,
I have got a problem sending mail with attachments...
I am able to send a plain mail ... but when i am trying to send mail along with an attachment ... its not being sent....
its not showing any error it is simply hanging...
what should i do?
If u know any solns please do suggest me....
Thanks in advanceactivation.jar is already there...
initially i wrote a swing program as a front end and it was working abs fine... in my sense it was properly sending mails along with the attachments...
when i changed the front-end to JSP handled by Servlets i am getting a problem...
and even the swing program stopped working ...
now swing program is getting compiled but it is hanging at run time showing an exception "Exception occured during event dispatching"
i dont understand what probably may be the problem...
if u can trace out, please give me any suggestions
Thanks in advance and regards -
Problem Sending mails in a loop using JavaMail API
Hello All,
I am sending emails in a loop(one after the other) using JavaMail API,but the problem is, if the first two,three email addresses in the loop are Valid it sends the Email Properly, but if the Fourth or so is Invalid Address it throws an Exception....
"javax.mail.SendFailedException: Sending failed;"
nested exception is:
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
javax.mail.SendFailedException: 450 <[email protected]>:Recipient address rejected: Domain not found......
So if i want to send hundereds of emails and if one of the Emails inbetween is Invalid the process Stops at that point and i could not send the other emails in the Loop......
How Could i Trap the exception thrown and handle it in such a way, so that the loops continues ..
Is there something with the SMTP Server....?
The code which i am using is as follows....
<Code>...
try {
InitialContext ic = new InitialContext();
Session session = (Session) ic.lookup(JNDINames.MAIL_SESSION);
if (Debug.debuggingOn)
session.setDebug(true);
// construct the message
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(eMess.getEmailSender()));
String to = "";
msg.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(to, false));
msg.setRecipients(Message.RecipientType.BCC,
InternetAddress.parse(eMess.getEmailReceiver(), false));
msg.setSubject(eMess.getSubject());
msg.setContent(eMess.getHtmlContents(),"text/plain");
msg.saveChanges();
Transport.send(msg);
} catch (Exception e) {
Debug.print("createAndSendMail exception : " + e);
throw new MailerAppException("Failure while sending mail");
</Code>....
Please give me any suggestions regarding it....and guide me accordingly..
Thanks a million in advance...
Regards
SamHow about something like the code attached here. Be aware it is lifted and edited out of an app we have here so it may require changing to get it to work. If it don't work - don't come asking for help as this is only a rough example of one way of doing it. RTFM - that's how we worked it out!
SH
try {
Transport.send(msg);
// If we get to here then the mail went OK so update all the records in the email as sent
System.out.println("Email sent OK");
catch (MessagingException mex) {
System.out.println("Message error");
Exception ex = mex;
do {
if (ex instanceof SendFailedException) {
if (ex.getMessage().startsWith("Sending failed")) {
// Ignore this message as we want to know the real reason for failure
// If we get an Invalid Address error or a Message partially delivered message process the message
if (ex.getMessage().startsWith("Message partially delivered")
|| ex.getMessage().startsWith("Invalid Addresses")) {
// This message is of interest as we need to process the actual individual addresses
System.out.println(ex.getMessage().substring(0, ex.getMessage().indexOf(";")));
// Now get the addresses from the SendFailedException
SendFailedException sfex = (SendFailedException) ex;
Address[] invalid = sfex.getInvalidAddresses();
if (invalid != null) {
System.out.println("Invalid Addresse(s) found -");
if (invalid.length > 0) {
for (int x = 0; x < invalid.length; x++) {
System.out.println(invalid[x].toString().trim());
Address[] validUnsent = sfex.getValidUnsentAddresses();
if (validUnsent != null) {
System.out.println("Valid Unsent Addresses found -");
if (validUnsent.length > 0) {
for (int x = 0; x < validUnsent.length; x++) {
System.out.println(validUnsent[x].toString().trim());
Address[] validSent = sfex.getValidSentAddresses();
if (validSent != null) {
System.out.println("Valid Sent Addresses found -");
if (validSent.length > 0) {
for (int x = 0; x < validSent.length; x++) {
System.out.println(validSent[x].toString().trim());
if (ex instanceof MessagingException)
ex = ((MessagingException) ex).getNextException();
else {
// This is a general catch all and we should assume that no messages went and should stop
System.out.println(ex.toString());
throw ex;
} while (ex != null); -
Problem sending mail with roaming profile (Outlook 2010)
Hello all,
I hope you will be able to help me.
Here's the problem I have with Outlook 2010:
When a user opens a roaming profile on another
PC or on his new
PC, everything works perfectly except
Outlook.
Outlook opens normally with all email
accounts, you can even see the email, no worries
about that.
But when we want to send an email, it
gets stuck in the outbox.
Some additional info:
- In the account settings,
you can test the account settings, it says
that everything is working (sending and receiving)
- The only way I found today to
operate the account is to
completely remove and reconfigure
- There is an error message
that says I can not write on the file C:\Users\UserName\AppData\Roaming\Microsoft\Outlook\accountName.pst
- The problem occurs with
all users, not just one in particular
- The accounts are IMAP
- Incoming emails work
Thank you for your help.Hi Tim,
This is a known issue in Outlook, we don't recommend using IMAP account with roaming profile.
For more information, you might want to read this similar thread:
https://social.technet.microsoft.com/Forums/office/en-US/f9b1bf03-d468-46e8-b40d-76fac11fd66c/outlook-2010-creates-new-imap-pst-files-at-random-and-cannot-send-mail-roaming-profiles-and-imap?forum=outlook
Regards,
Ethan Hua
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs. -
Problem sending mail with authentication
Please help as I've spent the last two days trying various things to solve my problem to no avail. I have been able to send email through the smtp server I have access to (just for interest, smtp.cs.stir.ac.uk), to email addresses in the same domain (e.g [email protected]) because the server does not require me to log in to do this - I can do it anonymously.
My problem comes when I try to send an email outwith the cs.stir.ac.uk subdomain, (e.g [email protected]) because it requires me to login. So I set about learning about authenticating with smtp servers using the javamail package, and I found two methods of doing it, both of which threw a javax.mail.AuthenticationFailedException. I believe this exception is only thrown when a username or password is wrong and I can't understand it because I'm definitely using the same user/pass combo as I do to log into my webmail. The stack trace for the exception is:
javax.mail.Service.connect(Service.java:264)
javax.mail.Service.connect(Service.java:134)
javax.mail.Service.connect(Service.java:86)
com.sun.mail.smtp.SMTPTransport.connect(SMTPTransport.java:144)
javax.mail.Transport.send0(Transport.java:150)
javax.mail.Transport.send(Transport.java:80)
EmailAuth.send(EmailAuth.java:80)
EmailAuth.<init>(EmailAuth.java:40)
EmailPanel.actionPerformed(EmailPanel.java:56)
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
java.awt.Component.processMouseEvent(Component.java:5093)
java.awt.Component.processEvent(Component.java:4890)
java.awt.Container.processEvent(Container.java:1566)
java.awt.Component.dispatchEventImpl(Component.java:3598)
java.awt.Container.dispatchEventImpl(Container.java:1623)
java.awt.Component.dispatchEvent(Component.java:3439)
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
java.awt.Container.dispatchEventImpl(Container.java:1609)
java.awt.Window.dispatchEventImpl(Window.java:1585)
java.awt.Component.dispatchEvent(Component.java:3439)
java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
And the code I'm using is:
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
import java.io.*;
public class EmailAuth
public String uname;
public String pword;
public EmailAuth(String host, String username, String password, String message,
String subject, String from, String[] to) throws MessagingException {
uname = username;
pword = password;
send(host, username, password, message, subject, from, to);
public void send( String host, String username, String password, String message,
String subject, String from, String[] to) throws MessagingException
boolean debug = false;
Properties props = new Properties();
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true");
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getDefaultInstance(props, auth);
session.setDebug(debug);
// create a message
Message msg = new MimeMessage(session);
// set the from and to address
InternetAddress addressFrom = new InternetAddress(from);
msg.setFrom(addressFrom);
InternetAddress[] addressTo = new InternetAddress[to.length];
for (int i = 0; i < to.length; i++)
addressTo[i] = new InternetAddress(to);
msg.setRecipients(Message.RecipientType.TO, addressTo);
// Setting the Subject and Content Type
msg.setSubject(subject);
msg.setContent(message, "text/plain");
Transport.send(msg);
private class SMTPAuthenticator extends javax.mail.Authenticator
public PasswordAuthentication getPasswordAuthentication(String username, String password)
return new PasswordAuthentication(username, password);
Any help is greatly appreciated!!try logging in to the SMTP server with that username/pwd manually. i've done this in win32 using telnet...
at the command prompt, enter "telnet mail.host.com 143", then from within telnet type "a1 login username password". the SMTP server should respond with something like "a1 OK LOGIN completed" if accepted. then, close the session by entering "a2 logout" (or just kill the telnet session).
the exchange should look like this:
telnet mail.host.com 143 * OK IMAP4rev1 server ready (3.0.14)
a1 login username password
a1 OK LOGIN completed
a2 logout
* BYE IMAP4rev1 Server logging out
a2 OK LOGOUT completed
Connection to host lost.
peace
bobD -
Problem sending mail with SMTP and SSL
Hi,
I am trying to send mail using JavaMail 1.4/jdk1.5 using ssl. I save the certificate by going into IE and exporting the certificate and added the certificate using the keytool to ${JAVA_HOME}/jre/lib/security/cacerts.I have also added this in the code using
System.setProperty("javax.net.ssl.trustStore","${JAVA_HOME}/jre/lib/security/cacerts");But I am still getting the following error.
DEBUG SMTP: trying to connect to host "XXXX", port 465, isSSL true
DEBUG SMTP: exception reading response: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Exception in thread "main" javax.mail.MessagingException: Exception reading response;
nested exception is:
javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1462)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1260)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
at javax.mail.Service.connect(Service.java:275)
at glycomics.common.util.SendMailUsingAuthentication.postMail(Unknown Source)
at glycomics.common.util.SendMailUsingAuthentication.main(Unknown Source)
Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:166)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1518)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1485)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1468)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1394)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:86)
at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:97)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75)
at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1440)
... 5 more
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:56)
at sun.security.validator.Validator.getInstance(Validator.java:146)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:105)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:167)
at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(SSLContextImpl.java:320)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:841)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:106)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:495)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:433)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:818)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1030)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:678)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
... 10 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:183)
at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:103)
at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:87)
at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:54)Has anybody faced similar problem??Any suggestions??
TIA
M
Message was edited by:
c@de-m@nkeySee SSLNOTES.txt and the JavaMail FAQ for debugging hints.
If you turn on all the debugging output and still can't figure it out,
you'll probably need to ask in some Java security forum. The
problem is occurring when making the connection using SSLSocket,
before any JavaMail code comes into play. -
Problems sending mail with Exchange SBS 2003 / apple mail
Here is an odd one. I can easily sync up with the exchange server at my office using my mac. I can view new mail, view sent mail and drafts easily.
When sending e-mail, it is a crap-shoot if it actually will send it or not. Sometimes it goes through, but the majority of the time it does not. I get delay messages from the server, and ultimately I get the "failed to send" message. But the mail is getting to the exchange server because I can see it in the queue.
Through Parallels, I was able to successfully configure and run Outlook 2004. When testing the same e-mail addresses, the Outlook mail went through easily, but the apple mail stalled and eventually failed.
On top of this, I can send e-mails to certain domains without ever getting an error through apple mail (i.e. a local company, hotmail.com, etc). Whereas others always or most of the time give me errors (cox.net, yahoo.com, another local company).
I checked the message queue on the exchange server and sure enough they were stuck trying to resend every 5 minutes - with no luck. There has to be a security setting or something preventing me from being able to send mail through my apple mail app.This was an issue with my Exchange server.
-
Problem sending mail with ATTATCHMENTS
hi all,
Im doing something like this to send a mail with attatchments:
msg.setRecipients(Message.RecipientType.TO, address);
msg.setSubject(subj);
MimeBodyPart textPart = new MimeBodyPart();
textPart.setContent(text, "text/plain");
File f = new File(filename);
MimeBodyPart attachFilePart = new MimeBodyPart();
FileDataSource fds = new FileDataSource(f);
attachFilePart.setDataHandler(new DataHandler(fds));
attachFilePart.setFileName(fds.getName());
Multipart mp = new MimeMultipart();
mp.addBodyPart(textPart);
mp.addBodyPart(attachFilePart);
msg.setContent(mp);
Transport.send(msg);
this is working for the first time........
if I execute this for the second time.... my attatchments are visibile inside the message..... something like this...
------=_Part_28_1086341.1034758766530
sd
<br>fa
<br>sdf
<br>sd
<br>
------=_Part_28_1086341.1034758766530
Content-Disposition: attachment; filename="2day's Work.txt"
Today's tasks done:
OCR conversion for the following:
1) pages rescaned in 12th class part A.
2) pages 61- in 12th class part C.
------=_Part_28_1086341.1034758766530--
it is showing the attatchment content inside when i run the same code for the second time....
anyone can help me out!!!
thax in adv,
kiranyup.. it worked navaz.....
thx a lot... may i know whatz happening here...
thx again...
kiran -
Send mail with attach by using Alert
Hi
How I can send email with BLOB attachment by using Alert,
Thanks
Edited by: Hani on Jan 17, 2013 1:59 PMHani wrote:
Hi
How I can send email with BLOB attachment by using Alert,
ThanksPlease see old threads for the same topic/discussion.
https://forums.oracle.com/forums/search.jspa?threadID=&q=attachment+AND+Alert&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
https://forums.oracle.com/forums/search.jspa?threadID=&q=attachments+AND+Alert&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
https://forums.oracle.com/forums/search.jspa?threadID=&q=attachment+AND+Alert+AND+Email&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
Thanks,
Hussein -
Problem in send mail with .txt file attached
According to the diferent checks, I found the next problems:
1.- Between each caracters there is an space, example:(E Q U I P M E N T) and could be (EQUIPMENT), the last one is the correct form.
2.- For example, two registers in my internal table appear in one line of my .txt file, but i want that each register of my internal table appear in differents lines of my .txt file.
3.- The length of each register of my internal table (objbin) is 255 characters, but i really want that the length of each register of my internal table be 1023 characters.
Thank youThis is my perform:
FORM z_envia_correo .
DATA: docu_data LIKE SODOCCHGI1,
tablines TYPE i,
destinatarios like somlreci1 occurs 1 with header line.
DATA: BEGIN OF packlist OCCURS 0.
INCLUDE STRUCTURE SOPCKLSTI1.
DATA: END OF packlist.
DATA: BEGIN OF objbin OCCURS 0.
INCLUDE STRUCTURE SOLISTI1.
DATA: END OF objbin.
DATA: BEGIN OF object_header OCCURS 0.
INCLUDE STRUCTURE SOLISTI1.
DATA: END OF object_header.
DATA: BEGIN OF contents OCCURS 0.
INCLUDE STRUCTURE SOLISTI1.
DATA: END OF contents.
*-->ihv270907
DATA: l_string TYPE string,
l_fecha(10) TYPE c,
l_dia(2) TYPE c,
l_mes(2) TYPE c,
l_ano(4) TYPE c,
l_hora(8) TYPE c,
l_h(2) TYPE c,
l_min(2) TYPE c,
l_seg(2) TYPE c.
*<--ihv270907
Variable del destinatario para enviar el mail
DATA: l_usrnam TYPE string.
*Caracter salto de linea
FIELD-SYMBOLS <hex_container> TYPE c.
CONSTANTS: zz_tab TYPE x VALUE '0D' LENGTH 4. "valor del salto de linea en hexadecimal
ASSIGN zz_tab TO <hex_container> CASTING.
cargo el texto de cabecera del mail
CLEAR docu_data.
docu_data-obj_name = 'ZFLOTA'.
CONCATENATE 'ZFLOTA' sy-datum INTO docu_data-obj_descr SEPARATED BY space.
docu_data-proc_type = 'T'.
docu_data-proc_name = 'ZFLOTA'.
cargo el texto del cuerpo del mail
CLEAR contents.
*-->ihv270907
l_string = TEXT-I04.
REPLACE '&' IN l_string WITH sy-uname.
l_ano = sy-datum+0(4).
l_mes = sy-datum+4(2).
l_dia = sy-datum+6(2).
CONCATENATE l_dia l_mes l_ano INTO l_fecha SEPARATED BY '/'.
REPLACE '&' IN l_string WITH l_fecha.
l_h = sy-uzeit+0(2).
l_min = sy-uzeit+2(2).
l_seg = sy-uzeit+4(2).
CONCATENATE l_h l_min l_seg INTO l_hora SEPARATED BY ':'.
REPLACE '&' IN l_string WITH l_hora.
contents = l_string.
*<--ihv270907
APPEND contents.
DESCRIBE TABLE contents LINES tablines.
READ TABLE contents INDEX tablines.
docu_data-doc_size = ( tablines - 1 ) * 255 + STRLEN( contents ).
cargo el contenido del attachmet
LOOP AT g_gt_outtab_mail.
g_gt_outtab_mail-line+254(1) = <hex_container>.
MOVE g_gt_outtab_mail-line TO objbin-line.
APPEND objbin.
ENDLOOP.
genero el nombre del archivo a ser attachado
CLEAR object_header.
object_header-line = 'ZFLOTA.txt'.
APPEND object_header.
armo las caracteristicas del mail
CLEAR packlist.
packlist-head_start = 1.
packlist-head_num = 0.
packlist-body_start = 1.
packlist-body_num = tablines.
packlist-transf_bin = space.
packlist-doc_type = 'RAW'.
APPEND packlist.
armo las caracteristicas del attachment
DESCRIBE TABLE objbin LINES tablines.
packlist-transf_bin = 'X'.
packlist-head_start = 1.
packlist-head_num = 0.
packlist-body_start = 1.
packlist-body_num = tablines.
packlist-doc_type = 'TXT'.
packlist-obj_name = 'ZFLOTA.txt'.
packlist-obj_descr = 'ZFLOTA.txt'.
packlist-doc_size = tablines * 250.
APPEND packlist.
Destinatarios
l_usrnam = sy-uname.
MOVE: l_usrnam TO destinatarios-receiver.
destinatarios-rec_type = 'B'. "U externo; B -> SAP
destinatarios-sap_body = 'X'.
APPEND DESTINATARIOS.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = docu_data
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = packlist
OBJECT_HEADER = object_header
CONTENTS_BIN = objbin
CONTENTS_TXT = contents
RECEIVERS = destinatarios
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.
ENDFORM. " z_envia_correo
Thank you. -
Problems sending mail with my internet connection through my iphone
HI all,
right now i'm having problems, i can't send a email with my outlook for mac through my iphone connection... but i can receive emails with the same connection... any ideas?Hi,
I've solved this problem. The problem was because i was using the
* Anexo - Descrição
packing_list-transf_bin = 'X'.
packing_list-head_start = 1. "Here it must be 0 because i wasn't using any table header
packing_list-head_num = 0.
ADD 1 TO tab_lines.
packing_list-body_start = 1.
CLEAR: lv_filename, tab_lines.
CONCATENATE nome_ficheiro 'TB' INTO lv_filename.
* CONCATENATE 'Fich Retorno -' nome_ficheiro INTO lv_filename.
DESCRIBE TABLE contents_bin LINES tab_lines.
packing_list-doc_type = 'TXT'.
packing_list-obj_descr = lv_filename."'Ficheiro Retorno'.
packing_list-obj_name = lv_filename.
packing_list-body_num = tab_lines.
packing_list-doc_size = tab_lines * 255.
APPEND packing_list.
Best Regards
Thanks,
João Martins -
Urgent - Sending mail with .txt attachment
Hi
I am having all the required data to be sent as attachment (.txt) in an internal table. How do I attach this data to the mail by using the FM SO_NEW_DOCUMENT_ATT_SEND_API1.
Regards,
VijayHi
Check this one
first create a Include report with the following coding
*& Include ZPA1_INCLFOR_MAIL *
* Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
* FORM
FORM ml_customize USING objname objdesc.
*----------- Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
*--------- Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
* FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
* FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
* FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
*--------- Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
* IMPORTING
* COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
* Header Data
* Already Done Thru FM
* Main Text
* Already Done Thru FM
* Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-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 = 'TXT'.
APPEND objpack.
* Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
* Receiver List
* Already done thru fm
ENDFORM. "ml_prepare
* FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
* CONTENTS_HEX = objhex
* OBJECT_PARA =
* object_parb =
receivers = reclist
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 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
* FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
*-------------- Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
*------------- Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
* FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
*-------- Data
DATA : pos TYPE i.
DATA : len TYPE i.
*------------ Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
<b>
Then include that report in the following report and copy the same code and paste it there </b>
*& Report ZPA_TEMP147 *
REPORT ZPA_TEMP147 .
INCLUDE zpa1_inclfor_mail.
* DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
* SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
* AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
* START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
* FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
* CHECK_DOS_FORMAT =
IMPORTING
* DRIVE =
EXTENSION = extension
NAME = name
* NAME_WITH_EXT =
* PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
Regards
Pavan -
Problem Sending Mail With IPod Touch
AOL is my primary ISP. The settings for the incoming and outgoing server for AOL are definately correct as confirmed by my serivce provider.
But for some strange reason i can receive all my emails but can not send a single one. Each time i get the error message: "Te connection to the outgoing server "stmp.aol.com" failed".
I've tried deleting the account and re-adding it but to no avail.
It seems to work fine for Yahoo and GMail, just not for AOL.
Was wondering if other people have the same problem or just me.I don't have AOL, but I initially had the same problem with Comcast. Then someone on this forum pointed out that, in the Mail setup, you have to put in your password for both ingoing and outgoing mail. It said the password for outgoing was "optional," but that was incorrect. Once I set the password for both, it worked fine. Maybe that's why some of you are having problems with other e-mail providers.
-
Problem sending mail with Gmail POP
A few days ago I began having trouble sending email through mail in my gmail account. (hope you got that) I checked my gmail account online and saw theat eventhough I got an :unable to deliver mail, please try another account message" from Mail, the message was sent according to gmail.
I went into my account settings and saw that my port was changed from 587 to 25. So i changed it back, I also noticed that my username was not how gmail had it listed, so i changed both and now i still get that message but the emails are getting sent according to gmail.
please helpI just began experiencing the same problem. I attempted deleting the pref's file and all other corresponding mail files out of my library to no avail.
Oddly, I can't seem to send out any other SMTP server either. -
Problems sending mail with 10.6? Just came across a Tech Note:
I haven't had issues but this may be helpful:
http://support.apple.com/kb/TS2998I am sure an Apple document detaling the setup will be released shortly ...
I'm not so sure I'd count on that. Apple wants you to purchase Lion, not tinker around with SL.
Anyhow, it isn't exactly a BUG, but more of.... (insert engineering excuse here)
This is as good a document as you are going to get:
iCloud: Mail server information
http://support.apple.com/kb/HT4864
Maybe you are looking for
-
Is there a solution for Higher Ed Computer Labs?
I am an instructional Technician for the Photography Department at a Community College. We currently purchase and use the Creative Suite 6 Design & Web Premium here in the Photography, Graphics and Journalism departments. We have over 150 Macintosh c
-
Absolute X Y position of a movie clip
Hi Can anyone tell me how to access the x y position of a movieclip on stage. I place each thumbnail image into a movie clip then I place that movieclip into another movie clip. I am trying to make a tooltip pop up appear over the image so in my mous
-
HomeSite+ bundled with Dreamweaver MX 2004
I bought Dreamwreaver when it was owned by Macromedia. At that time it was bundled with Flash MX 2004 and HomeSite+. This last piece of software turned out to be a very handy code editor which I have used ever since. As Windows versions came and went
-
3 Questions, please HELP..
Hello, I have some Questions.. I want HR Authorizations into BI 7.0. Is there any tool or like that to do it ???? Exist in the BI Content HR Datasources to to create this solution ???? How can i do it, the best way If yes, someone give me more Inform
-
Let FMSI 3.5 stream to Wowza
Since FMS has no options to stream to an ipad of iphone I tried to let FMS stream to a Wowza server by using NetConnection / NetStream classes. It seems to work (not getting any errors in the logs) but nothing happens when I try to read the stream fr