SEND EMAIL WITH PO AND ATTACHMENT FILES
Hi,
I'm working with MySAP Enterprise 4.7 and I want to send the PO and its attachment vía e-mail, currently only the PO is being sent to the Vendor and the attachment only appears like texts into the "body" of PO. Is there some way to send e-mail with the PO and attachments at the same time??
I attached the document via DMS at position level.
Thanks in advanced for your answer and help!!
Regards,
Blanca Reyes
hi
Follow these steps
Basically there are two mail types: Internet mail (external mail) and
SAPOffice mail.
Mail is sent via the output determination in both cases.
If you use the external mail, the message for the purchasing document is
converted into a corresponding text file which is sent to the vendor via
the Internet.
SAPOffice mail is sent only within the R/3 System and has mainly the
function of providing information.
In particular, it is not possible to attach a message (form) for a
purchasing document to a SAPOffice mail.
When using external mail, the following basic settings are required:
1. You must maintain an e-mail address in the address in the vendor
master.
2. The same applies to your own user master. You also have to specify
an e-mail address there in order to identify the sender.
o Note that it is not possible to change the e-mail address of the endor
o You can use a temporary email address in Transaction ME21N.
3. For the output type for default values, a communication strategy
needs to be maintained in the Customizing that supports the e-mail.
You can find the definition of the communication strategy in the
Customizing via the following path: (SPRO -> IMG -> SAP Web
Application Server -> Basic Services -> Message Control -> Define
Communication Strategy). As a default, communication strategy CS01
is delivered. This already contains the necessary entry for the
external communication. Bear in mind that without a suitable
communication strategy it is not possible to communicate with a
partner via Medium 5 (external sending).
4. Use the standard SAP environment (program 'SAPFM06P', FORM routine
'ENTRY_NEU' and form 'MEDRUCK') as the processing routines.
5. In the condition records for the output type (for example,
Transaction MN04), use medium '5' (External send).
6. You can use Transaction SCOT to trigger the output manually. The
prerequisite for a correct sending is that the node is set
correctly. This is not described here, but it must have already been
carried out.
7. To be able to display, for example, the e-mail in Outlook, enter PDF
as the format in the node.
To use the SAPOffice mail, the following basic settings are required:
1. For the output type for default values, a communication strategy
needs to be maintained in the Customizing that supports the e-mail.
You can branch to the maintenance of the communication strategy via
the input help.
2. Use the SAP standard environment (program "RSNASTSO" and FORM
routine "SAPOFFICE_AUFRUF") as the processing routines.
3. In the condition records for the output type (for example,
Transaction MN04), use medium '7' (SAPOffice) and also partner role
'MP' (mail partner).
Additional settings:
Problem:
How can you both change the mail title and text for the sending of a
mail message and maintain a replacement parameter, for example a
document number.
Solution:
1. The replacement routine is maintained in the Customizing for the
output type in the detail screen on the 'General data' tab under
'Replacement of text symbols' (for Release < 4.6B, this can be found
on the 'Mail' tab page).
Program: SAPMM06E
FORM routine: TEXT_SYMBOL_REPLACE
2. Maintain mail title and text.
o If you want to send a purchase order within an R/3 system using
the SAP office, you can maintain both the mail title ('Re:') and
also a mail text in the Customizing for the output type To do
this, select the directory mail title and text for the
corresponding message type.
o If you want to send a purchase order as (external) mail, for
example, to a vendor, you have to maintain the mail title in the
condition record for the output type (for example in Transaction
MN05) on the 'Communication method' tab page. Enter the mail
title in the 'Text for cover page' field. You cannot maintain an
additional mail text.
o Note that the values from the mail title are used to create the
description for the attachment.
3. The replacement parameters must be enclosed by &. Example: You want
to enter the title 'PO number '. For this you have to enter
the following in the Document Title field (Message Customizing ->
sub-option: Mail title and texts) 'PO number &EKKO-EBELN&'
Reward points if helpful
regards
chetan
Similar Messages
-
attempted to mail an email with a large attachment file. One of the addresses was bad. When my Outlook is running, the Mac tries to send it and shows the progress. However, when I look in my Outbox the files are not there. It does show up in the Outbox progress section but I can not delete it when it is there.
Where do these files reside?
Is there a hidden Outbox??
MacBook Pro, Mac OS X (10.7.1)If you think getting your web pages to appear OK in all the major browsers is tricky then dealing with email clients is way worse. There are so many of them.
If you want to bulk email yourself, there are apps for it and their templates will work in most cases...
http://www.iwebformusicians.com/Website-Email-Marketing/EBlast.html
This one will create the form, database and send out the emails...
http://www.iwebformusicians.com/Website-Email-Marketing/MailShoot.html
The alternative is to use a marketing service if your business can justify the cost. Their templates are tested in all the common email clients...
http://www.iwebformusicians.com/Website-Email-Marketing/Email-Marketing-Service. html
"I may receive some form of compensation, financial or otherwise, from my recommendation or link." -
How to send Email with Cc and Bcc using MailPackage
Hi ,
we are using Mail Package to send the Email using Mail Adapter.We have a requirement where we need to send Email with Cc and Bcc using Mail Package .
Can we send Cc and Bcc using Mail Package ?
Thanks
Rajesh .HI Rajesh,
There is a standard structure for Receiver Mail adopter which we can get from SAP market Place but it is not provided with CC if u want to use CC then you have to go with Dynamic Configuration.
DynamicConfiguration configuration = (DynamicConfiguration) container.getTransformationParameters().getStreamTransformationConstants.DYNAMIC_CONFIGURATION);
/*any other required fields*/
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/Mail", "THeaderCC");
configuration.put(key, "ccemail @ test.com");
Regards
Praveen Reddy
Edited by: Maareddy Praveen Reddy on Aug 10, 2011 12:17 PM -
Sending email with report as attachment
Dear folks,
I'm using [this |http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html] package to send emails through database, and it works.
My question is: how to attach report to email which is sent by this package?
Any help on this would be highly appreciated.
Regards,
AdnanadnanBIH wrote:
Dear folks,
I'm using [this |http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html] package to send emails through database, and it works.
My question is: how to attach report to email which is sent by this package?
Any help on this would be highly appreciated.
Regards,
AdnanDear Adnan. I've written a blog post on this subject. You can view it from the following link:
http://kamranagayev.wordpress.com/2009/02/23/using-oracle-utl_file-utl_smtp-packages-and-linux-shell-scripting-and-cron-utility-together-2/ -
Send email with attachments and change calendar
hi,
2 questions,
first how can i change the datepicker icon? i want to use something slightly fresher that i have, say an image of a calendar for example?
the second question is a bit more ocmplicated.
i ahve used the send email behaviour no prolems at all, however i need to be able to on an existing site i used to build with addt have the ability to email documents that are uploaded by addt behaviours into the site?
so at the moment you can upload, delete and view the documents. the documents are displayed in a repeating table, i need to be able to have checkboxes next to each documents name and when selected when the person clicks the submit button it email the message with documents attached to an address they specify?
any help would be great.
thanksthansk gunter,
i am happy to try figure it out using addt, ill have a go with checkboxes next to the recordset, i could set the ticked value of the checkbox to the name of the document from the recordset and give it a go?
i think it would have been a cool out the box feature, if you can help at all when you can with trying to impliment i would really appreciate it and i think it will definately help other users at the same time.
i have to say i love addt, so sad it is not around as such. i have noticed a few users talking about php5.3 support and just want to let users know i found a site which has the includes file patched:
http://www.interaktonline.info/files/47-ADDT-1.0.1---PHP-5.3-compatibility-patch.html
great site and think that users should have a look at it. not sure if that solves the issues people are having or not. i just stumbled across it and be good if users could keep our heads together to try and keep this great product alive for as long as we can.
anyway i just thought i would share that with you guys.
hope it helps and hope you can help guide me gunter with the email query.
many thanks -
FDM Send Email with a Report attachment
Hi All,
I'm currently trying to roll out a form of "Lights - Off " automation in for HFM version 9.3.3 , by using the FDM Task Manager to schedule loading information from my organisation's source system JDE.
The final element of that automation from our perspective is to have an alert email from FDM to certain users once the 4 - Fish process is complete.
This has worked successfully using 'Send Mail' from Accelerators, however what would be even more useful is to be able to either attach Process/Check Reports.
I am only a beginner in VB but am willing to take steps if someone can point me in the right direction of either adding the report in the body of the email or as an attachment. I saw a great example of an email alert from Tony Scalese on the attached link
http://www.fdmguru.com/enabling-lights-out-automation/
Any help would be much appreciated.
Cheers
PipI assume your familiar with the 'Send Mail' Accelerator script so i won't go into that part of it.
As mentioned previously I opted to attach the source file and save reports on a shared drive. Therefore from the selected script below you can modify to your needs.
Firstly I published a report (using the Report Publishing accelerator) to a specific location with a variable name (as shown in my example below) or you can give it a specific name so each time it's run it will overwrite the previously run report.
Publish Report*
Dim objReport
Dim lngReportID
Dim lngPublishType
Dim strPublishPath
'Initialize Variables
lngReportID = 87 'Check Report +(You need to check the report properties for this number)+
lngPublishType = 31 'PDF
strPublishPath = "C:\Temp\Validation Report_"&API.POVMgr.PPOVLocation&"_"& API.POVMgr.PPOVCategory &"_"& API.POVMgr.PPOVPeriod &"_"& FormatDateTime(Date,1)&"_"&retv&".pdf"
'Create the Report object
Set objReport = CreateObject("upsWReportingDM.clsReportPublisher")
objReport.mInitialize API
'Publish the Report
objReport.mReportPublishToFile CLng(lngReportID), CStr(strPublishPath), CLng(lngPublishType)
'Destroy the objects
Set objReport = Nothing
To attach this to your email :
.AddAttachment strPublishPath
This should get you on your way, let me know if you encounter any issues. Also as a newbie I'd appreciate it if you can tag if this message was correct or helpful.
Cheers
Pips -
Send EMail with *.txt as attachment.
Hi All i have the data in the internal table and i want to send that data as attachment for mail in notepad format.plz send any sample program.
the file should be in notepad format
thanks & Regards
vamsinuse the below program and just pass your internal table and activate it .... it will give you the attach file of the data in txt format .. see the email id which is defualt ... change it as you email id ..
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_sender LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
* Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
* Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
START-OF-SELECTION.
* Write statement to represent report output. Spool request is created
* if write statement is executed in background. This could also be an
* ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
PERFORM process_email.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM
FORM get_job_details.
* Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
* perform send_email using p_email2.
ENDFORM.
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
* Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
* CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
* If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
ENDIF.
* Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'TXT'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
FORM send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
* 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 = '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 = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
* Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
* Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
* Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
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.
* Populate zerror return code
ld_error = sy-subrc.
* Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
[code]FORM send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
* 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 = '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 = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
* Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
* Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
* Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
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.
* Populate zerror return code
ld_error = sy-subrc.
* Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
reard points if it us usefull ...
gIRISH -
Send email with html and images over Sockets
Hi! I'm sending email messages through sockets with html. So far is working great. But now, I need to include images in the html code, like a web page. I don't have any idea on how to do this. Sending image apart from the html code is not big deal, but how to put it in the code. I mean how to make this html code, work:
<table border="0">
<tr>
<td>Image in code</td>
</tr>
<tr>
<img src="what to put here"/>
</tr>
</table>This is the code that I'm using to send the html mail:
StringBuffer retBuff = new StringBuffer();
//BufferedReader msg;
//msg = new BufferedReader(msgFileReader);
smtpPipe = new Socket(mailHost, SMTP_PORT);
smtpPipe.setSoTimeout(120000);
if (smtpPipe == null) {
return retBuff;
inn = smtpPipe.getInputStream();
outt = smtpPipe.getOutputStream();
in = new BufferedReader(new InputStreamReader(inn));
out = new PrintWriter(new OutputStreamWriter(outt), true);
if (inn == null || outt == null) {
retBuff.append("Failed to open streams to socket.");
return retBuff;
String initialID = in.readLine();
retBuff.append(initialID);
retBuff.append("HELO " + localhost.getHostName());
out.println("HELO " + localhost.getHostName());
String welcome = in.readLine();
retBuff.append(welcome);
retBuff.append("MAIL From:<" + from + ">");
out.println("MAIL From:<" + from + ">");
String senderOK = in.readLine();
retBuff.append(senderOK);
for (int i = 0; i < to.length; i++) {
retBuff.append("RCPT TO:<" + to[i] + ">");
out.println("RCPT TO:<" + to[i] + ">");
String recipientOK = in.readLine();
retBuff.append(recipientOK);
retBuff.append("DATA");
out.println("DATA");
out.println("From: Steren <" + from + ">");
out.println("Subject: " + subject);
out.println("Mime-Version: 1.0;");
out.println("Content-Type: text/html; charset=\"ISO-8859-1\";");
//out.println("Content-Type: multipart/mixed; charset=\"ISO-8859-1\";");
//out.println("Content-Transfer-Encoding: 7bit;");
//String line;
//while ((line = msg.readLine()) != null) {
// out.println(line);
out.println(msg);
retBuff.append(".");
out.println(".");
String acceptedOK = in.readLine();
retBuff.append(acceptedOK);
retBuff.append("QUIT");
out.println("QUIT");
return retBuff;Throw all this away and use one of the numerous existing Java mail packages, such as javax.mail for a start.
-
Trying to send email with a photo attached?
Hi Guys thanks for all your information I have carried out your requests it is still freezing and not sending.
I have also followed the instructionsin in the booklet (getting started with PE11)and it is still freezing and not sending.
The last line is Photoshop Elements 11 say's opens the message in your default email application
where do i find this??
Thanks againHi,
From what I remember, Yahoo is a web based mail client. Does this mean that in Edit -> Preferences -> Sharing you have selected Adobe Email Service in the Email client box?
When you freeze, try hovering over the organizer icon in the taskbar - are there two instances? One might be headed New Message - right click on it and select maximize. See if that then displays the message.
Brian -
Can't send email with EDGE and Earthlink ISP
I cannot send email using EDGE. Receiving email is ok. My ISP is Earthlink. I contacted Earthlink support and they admit they don't have a clue. I have trid the setting specified by Iphone users guide, Apple mail setup asst., Apple support docs, Earthlink, etc. Nothing has worked.
Thanks for any helpThanks for everyone's input. For the most part,I got the same suggestions from everyone here,the Apple support docs, the Earthlink support docs, and Earthlink support rep. All to no avail. For others that have this problem.
THE SOLUTION: You must plug in your phone to itunes, uncheck to sync, and eject the iphone. Then mannually setup the acccount as directed by the Apple support docs, same settings as shown in the Earthlink support docs.
This worked for me. -
Send email with password protected zip file attachment
Hi Experts,
The requirement is to zip a password protected excel file and send the zipfile through email. There is no middleware(PI) involved. The program has to be run in background mode. It is possible to create a password protected excel file using OLE method, but it will not work in background mode.
Also it is possible to place the zip file in application server, but I am not able to give password for this file.
Any help would be greatly appreciated.
Regards,
Renjith NairHi,
You have to write a customer adapter module to handle this requirement.
Zip/Unzip can be done using the payloadzipbean standard module:
http://help.sap.com/saphelp_nw04/helpdata/en/45/da9358a1772e97e10000000a155369/content.htm
/people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
Is encoding an option instead of password for you:
/people/farooq.farooqui3/blog/2008/09/24/sap-xipi-encode-outgoing-payload-using-adapter-module -
Send email with microsoft word attachment
Hi,
I need to send the microsoft word as an attachment to external email. When I send an email using transaction SBWP to external email, the recipient will receive the attachment in Microsoft word format. But when I send the attachment to external email using my program, the Microsoft word automatic change to pdf. Kindly help. Attach is my sample program.
*& Form send_email
FORM send_email .
LOOP AT raw_tab.
MOVE raw_tab-l TO it_attach-line.
APPEND it_attach.
ENDLOOP.
WRITE 'Test' TO w_doc_data-OBJ_DESCR.
perform get_packing.
perform populate_email_message_body.
perform receiver.
lt_objhead = 'TEST'.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
object_header = lt_objhead
contents_bin = it_attach
contents_txt = it_message
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.
COMMIT WORK AND WAIT.
ENDFORM. " send_email
*& Form get_packing
FORM get_packing .
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-body_num = t_packing_list-body_num.
t_packing_list-doc_type = 'TXT'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_attach LINES body_num2.
t_packing_list-body_num = body_num2.
t_packing_list-doc_type = 'DOC'.
t_packing_list-obj_descr = 'TXT attachment'.
t_packing_list-obj_name = 'ATTACHMENT'.
DOC_SIZE2 = ( ( body_num2 - 1 ) * 255 ) + STRLEN( it_message ).
t_packing_list-doc_size = doc_size2.
APPEND t_packing_list.
ENDFORM. " get_packing
*& Form populate_email_message_body
form populate_email_message_body.
REFRESH it_message.
it_message = 'Testing program'.
APPEND it_message.
ENDFORM. " populate_email_message_body
*& Form receiver
FORM receiver .
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
t_receivers-receiver = [email protected]'.
APPEND t_receivers. clear t_receivers.
ENDFORM. " receiverjust pass mail Id and the Pc file path of word doc in the selection screen of the below program ,it will send it as word attachment to the recepient.pls reward points if helpfull -
REPORT ZGILL_SENDMAIL_PDF .
INCLUDE ZGILL_INCMAIL. "SEE BELOW FOR INCLUDE PROGRAM CODE.
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 DEFAULT '[email protected]'.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY DEFAULT 'C:\TEMP\SALARY_SLIP1.PDF'.
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
*********************iNCLUDE pROGRAM********************************************
*& Include ZGILL_INCMAIL *
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
**********************INCLUDE END******************************** -
Sending emails with 5800 and perhaps other phones
I have noticed several people complaining that although they could receive emails on any email address they had set up in the phone, they could not sent a reply via that same email addresses e,g, Tiscali.
A way to overcome this problem is thus - Have a second email address set up on the phone (Yahoo for instance). Now,on receiving an email from say Tiscali; type a reply; then, before sending it, change to the Yahoo account and then send it. Of course, if your normal email account is already Yahoo or some other one which works both ways; you already have no problem.Thank you for your response Mikael.
For the first question, I was able to find the solution in the following blog:
XI Mail Adapter : Dynamically building attachment and message body content using a simple UDF
(I just needed to search with the right set of key words )
The key is to set the "Content Encoding" as "None" in the mail adapter. If this is not done, the mail will be sent with an attachment - untitled.bin containing both the mail body and the attachment text. Also, don't forget to check the "Keep Attachments" checkbox in the mail adapter.
Multiple recipients could be added by separating the email IDs with a Comma. I have used ASMA to set the recipients. -
Sending email with an excel attachment
Hi,
I have designed one workflow for PO approval .For the release code 01 i am displaying the one custom report to the approver .
Now the requirement is after release of the code 01 i have to download this custom report into excel format and i have to send this excel sheet to the vendor email id through workflow .
Please can any one give me how to achieve this functionality of downloading the report and sending this to vendor in background task.
Regards
PaveeYou can make use of FM
SO_NEW_DOCUMENT_ATT_SEND_API1
For use of this FM try to search with this FM as keyword in ABAP Forum.
Thanks
Arghadip -
Send Email with Lines 255Char attachment
Is itpossible in SAP?
I want my line to be read in the notepad and keep linebyline.
When I use WS_DOWNLOAD =>100% what I want
Idon'tknow how to do it by mail!
Use the fm SO_DOCUMENT_SEND_API1 but how?Hi,
I just found a quite neat way of dealing with this problem that works well... Here is some example code... Its based on the BCS_EXAMPLE_1 program but instead of messing around with the texts table as I was having issues with linefeeds I convert my extract table into a string and manually add linefeed characters. From here I convert the STRING to the XSTRING format and finally into the SOLIX_TAB format. I noticed that if you specify the attachment type as TXT you get the correct extension and it opens as desired in your text editor.
Regards,
Pete White
*& Form email_extract
text
-->P_GT_FULL_DATA[] text
-->P_P_EMAIL text
FORM email_extract USING it_gt_zartifoo TYPE ty_ta_zartifoo
ic_email TYPE ad_smtpadr.
DATA: str TYPE string,
ls_zartifoo TYPE zartifoo,
ls_string TYPE string,
ls_xstring type xstring.
DATA: text_content TYPE soli_tab,
bin_content type solix_tab.
TRY.
-------- create persistent send request ------------------------
send_request = cl_bcs=>create_persistent( ).
-------- create and set document -------------------------------
create document from internal table with text
CLEAR text_content[].
LOOP AT it_gt_zartifoo INTO ls_zartifoo.
ls_string = ls_zartifoo.
CONCATENATE str ls_string cl_abap_char_utilities=>cr_lf INTO str.
ENDLOOP.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = str
MIMETYPE = ' '
ENCODING =
IMPORTING
BUFFER = ls_xstring
EXCEPTIONS
FAILED = 1
OTHERS = 2.
CALL METHOD cl_document_bcs=>xstring_to_solix
EXPORTING
ip_xstring = ls_xstring
receiving
rt_solix = bin_content.
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = text_content
i_subject = 'Depositos Material Extract' ).
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'TXT'
i_attachment_subject = 'ARTIFOO'
i_att_content_text = text_content.
i_att_content_hex = bin_content.
add document to send request
CALL METHOD send_request->set_document( document ).
--------- set sender -------------------------------------------
note: this is necessary only if you want to set the sender
different from actual user (SY-UNAME). Otherwise sender is
set automatically with actual user.
sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
--------- add recipient (e-mail address) -----------------------
create recipient - please replace e-mail address !!!
recipient = cl_cam_address_bcs=>create_internet_address(
ic_email ).
add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
---------- send document ---------------------------------------
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = sent_to_all ).
IF sent_to_all = 'X'.
WRITE text-003.
ENDIF.
COMMIT WORK.
* exception handling
* replace this very rudimentary exception handling
* with your own one !!!
CATCH cx_bcs INTO bcs_exception.
WRITE: text-001.
WRITE: text-002, bcs_exception->error_type.
EXIT.
ENDTRY.
ENDFORM. " email_extract
Maybe you are looking for
-
Hi, My RFC senario is giving me an error,I went to component monitoring-->Adapter Monitoring and saw the list of adapters.I see that the RFC adapter is red,does it mean the adapter is down?how do I troubleshoot it?This is the error I have in RWB. Sen
-
Can SQL Developer Data Modeler work with OBIEE?
Can SQL Developer Data Modeler work with OBIEE? Can we export the data model from the Data Modeler and import it into OBIEE? Or export the OBIEE metadata to the Data Modeler for Data Model defining?
-
Branding and static text in detail nav.
I have a requirement to add some static text at the bottom of the detailed navigation in the portal. I accomplished this by creating a static HTML page in KM, creating an iView that points to that document, and assigning that iView to the Detailed N
-
How i can display i_tab data in smartform as required
hi all i have tried a lot but not able to make logic for displaying data frm i_tab to SF as required , my requirement is , i have data in i_tab as given below field 1, 2,3,4, are TRNTYP CHAPID MATNR MAKTX OF J_1IEXCDTL respectivly.
-
Getting (error code -6584) when starting time machine
Hello, I have an early 2011 mbp running Lion. I tried this morning to start time machine and got the error described above. I have access to my time capsule but the program will not start. This is the first time I start time machine since installing