Personalising E-mail with accompanying form
Can anyone help? When we send out an adobe form for people to fill in and return the e-mail that goes out has Adobe logo all over it. Is there any way we can personalise email with our own company name/logo? Many thanks.
I have the same situation (( what to do?
Similar Messages
-
E-mails with Interactive Forms by WebDynpro for ABAP
Hello,
I plan to use WebDynpro for ABAP and Adobe Interactive Forms.
I want to send e-mails with PDF files which are created by Interactive Forms.
Please let me know
- How to send e-mails by WebDynpro for ABAP
- How to attach PDF files.
Best regards,
KojiThanks,
I checked WDR_TEST_MAILT, but I want to know is
how to send e-mails using ABAP method because
in my case addresses and some data are stored add-on tables, and extract them on e-mails.
Regards,
Koji -
Sending a email with the form attached but no submit Button
Hi experts,
I have designed a form in ABAP using the t-code SFP. i Have a button "accept", in the form.
Now i am calling this form from an executable program and send it to mail with the form attached.
I am successfully receiving the mail with the form attach.
Now my requirement is when i open the attached form and click on ACCEPT button, again a mial shud be triggered with the same form attached but no ACCEPT button shud appear on the form.
I am able to trigger the mail on click of the ACCEPT button and mail is also sent withj the form attached , but the ACCEPT button still exists.
I have written the following code on click of the button.
this.presence = "invisible";
event.target.submitForm();
Please some expert help me in solving this problem as soon as possible.
Thanks and Regards,
MadhuDid you get my point hwta i have mentioned? The steps which I have suggested will solve your problem.
Please add one dummy attribute (One Char length) to the Form interface.
In the form add one hidden field - SubmitFlag and bind this to the dummy attribute of the interface. Before submit set this flag to Y.
On form Load check if Submit Flag is Y or not. if it is then hide the button agin.
This will work fine for you.
If after implementing this it will not work, send it to my Id [email protected]
But first i will suggest to try yourself.
Cheers
Satya -
Once completed the form, is it possible to receive the confirmation e-mail with a link addressing to a html archive?
I don't know if it is the best solution but you could filter the results to just that client's answers on the summary tab and then PDF that.
-
How to send the form data through mail with pdf format?
forms 6i
Hi to all,
i am developed one master detail form.example is based on the dept number emp details will be displayed.here my requirment is whatever displayed on the form
the data ,these data send to mail with any format.is it possible? if is possible any one give a proper solution.
Regards,
Stevie
Edited by: 994418 on 6 May, 2013 11:15 PMHello,
you can create a Report that accepts the search parameters from the Forms mask and generates a PDF. You also have the option to send the report via mail.
Personally I would generate the report with a tool like as_pdf
http://technology.amis.nl/2012/04/11/generating-a-pdf-document-with-some-plsql-as_pdf_mini-as_pdf3/
Then you can send the mail using utl_mail or utl_smtp.
www.google.com/search?q=site:forums.oracle.com+utl_mail+utl_smtp
Regards
Marcus -
Hello, staff!
My site (http://теле.онлайн) have a contact form and i can't public site even on bys.catalist by using e-mail for sending form by my host-provider: info@теле.онлайн. If i use another one, for example my own - [email protected] - it is ok on bys.catalist, but it not working on my host, becouse the terns only allow to use their e-mail - info@теле.онлайн.
So, what we got now if i try to use info@теле.онлайн:
Can't public site on buisness catalist servise with that mistake - 400 bad gateway. (117007);
if i export site as HTML and load it to my host by using FileZilla - forms don't work with that message: theres mistake on server.
I've contacted with my host-provider and they say that only info@теле.онлайн are allowed to be used in form.
So now i need to know - is that possible to configure Muse with that e-mail?
What if not? I have a contract with Adobe for 1 year, what should i do now?
PS sorry for my english it's pure, but i'm trying my bestCreate a New User Account, and as that New User try to set up this one account -- as it is POP, set to leave messages on the server after download. If not familiar with setting up a New User Account, see:
http://docs.info.apple.com/article.html?path=Mac/10.5/en/8235.html
This will be a useful test, and is not meant to suggest a permanent switch to the New User Account, but rather a test of the Mail application outside of your normal User Account.
Also in System Preferences/Networks click on Advanced, then Proxies and make sure no proxy selections have been checked.
Ernie
Message was edited by: Ernie Stamper -
I want to send multiple e-mails, one to each recipient, with a standard letter, but with a personalised greeting, attached. I want to set up the e-mail list and send them mout without having to do each e-mail separately. It would be like a mail merge except using e-mails with an attachment.
https://addons.mozilla.org/en-US/thunderbird/addon/mail-merge/?src=ss
-
Mail with leave notification form
hi experts!!
could anyone pl tel me how to send a mail with leave notification form.Thanks in advacne!!!
Edited by: Ranganayahi Chandirasekaran on Apr 11, 2008 11:34 AMHi,
Leave notification for this u can check this site,
http://help.sap.com/saphelp_nw04/helpdata/en/e6/56a038d14a2571e10000009b38f8cf/frameset.htm -
Workflow Triggering mail to Microsoft Outlook with PO form in PDF
Hi All,
My workflow has a task and in that task i have called a method which will take the spool number of the PO created and transfer the same to PDF and send mail to the agent which I have mentioned.
When I independently run the method from SWO1, it triggers mail and PDF.
The send the the mail with pdf attachment, i have refered the standard program "BCS_EXAMPLE_8"
But when I try to do it through workflow, it is giving the following error.
1) Exception occurred Error handling for work item 000000047921.
2) Executing batch work item Work item 000000047921: Object ZBUS2012 method ZSEND_MAIL cannot be executed.
3) EXECUTE_METHOD_OBJECT_SYNC Application method has processed message 'E'; see long text
4) EXECUTE_METHOD_BOR Application method has processed message 'E'; see long text
5) EXECUTE_METHOD_BOR Application method has processed message 'E'; see long text
Regards,
Rahul.Hi Abdul,
Yes, i didnt assign e-mail address WF-BATCH.
Now after assigning e-mail address for WF-BATCH in T-code, SU01, it is working fine.
Thank you very much, i was really struck with this issue for last 5 days.
Regards,
Shegar. -
Sending mail with multiple attachment
hi.
i want to send mail with multiple attachment.
i m succeed in sending multiple attachment but the second pdf is not open.
its given error like "This file is damaged and could not be open.
pls check my code. and
give the solution....
point should be assured...........
hope all u r understand my problem..
& tell me where is i m missing something.
REPORT YSDPASALE1_MAIL LINE-SIZE 110.
data : year_month(6) type c.
data : from_date like sy-datum,to_date like sy-datum.
INITIALIZATION.
year_month = sy-datum+0(6).
CONCATENATE year_month '01' into from_date.
to_date = sy-datum.
ranges : temp for mkpf-budat.
temp-low = from_date.
temp-high = to_date.
append temp to temp.
DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,
jobname like TBTCJOB-JOBNAME,
L_RELEASE(1) TYPE c.
CONSTANTS : l_c_device(4) VALUE 'LOCL'.
DATA : t type i value 0.
DATA : p_email1 like somlreci1-receiver,
p_sender LIKE somlreci1-receiver.
Data Declaration
DATA: gd_recsize TYPE i,gd_recsize1 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,
it_mess_att1 LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att2 LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_desc1 TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des,
gd_mtitle LIKE sodocchgi1-obj_descr.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
DATA: BEGIN OF mailstr OCCURS 0,
p_email like somlreci1-receiver,
END OF mailstr.
DATA: mailtab like STANDARD TABLE OF mailstr WITH HEADER LINE.
DATA: ypp18tab like STANDARD TABLE OF mailstr WITH HEADER LINE,
ymis008tab like STANDARD TABLE OF mailstr WITH HEADER LINE,
ysd15tab like STANDARD TABLE OF mailstr WITH HEADER LINE,
ymis10tab like STANDARD TABLE OF mailstr WITH HEADER LINE.
SUBMIT YSDPASALE1 with bdt in temp
to sap-spool
with line-size = '255'
with KEEP_IN_SPOOL = 'X'
with IMMEDIATELY = ' '
WITHOUT SPOOL DYNPRO
AND RETURN
NEW-PAGE PRINT ON
DESTINATION l_c_device
IMMEDIATELY ' '
KEEP IN SPOOL 'X'
NEW LIST IDENTIFICATION 'X'
NO DIALOG.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
PERFORM convert_spool_to_pdf.
select yemail as p_email into CORRESPONDING FIELDS OF TABLE ymis008tab
from ymail
where ytcode = 'YMIS008'.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool & mail sending',
'request to be created.'.
ENDIF.
wait up to 3 seconds.
submit YSD_MONTHLY_SALES
USING SELECTION-SET 'MAIL'
to sap-spool
with KEEP_IN_SPOOL = 'X'
with IMMEDIATELY = ' ' "SPACE
WITHOUT SPOOL DYNPRO
AND RETURN
NEW-PAGE PRINT ON
DESTINATION l_c_device
IMMEDIATELY ' '
KEEP IN SPOOL 'X'
NEW LIST IDENTIFICATION 'X'
NO DIALOG.
new-page print off.
IF sy-batch EQ 'X'.
gd_attachment_desc1 = 'YMIS10'.
gd_mtitle = 'Monthly Sales Report'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
PERFORM convert_spool_to_pdf1.
loop at it_mess_att.
move it_mess_att1 to it_mess_att.
APPEND it_mess_att.
endloop.
APPEND LINES OF it_mess_att1 to it_mess_att.
free it_mess_att1.
it_mess_att[] = it_mess_att1[].
insert LINES OF it_mess_att1 into it_mess_att.
APPEND LINES OF it_mess_att2 to it_mess_att .
insert LINES OF it_mess_att1 into it_mess_att.
insert LINES OF it_mess_att2 into it_mess_att.
loop at ymis008tab into mailstr.
p_email1 = mailstr-p_email.
p_email1 = '[email protected]'.
PERFORM process_email.
endloop.
clear mailstr.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ELSE.
SKIP.
ENDIF.
FORM obtain_spool_id *
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 *
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 convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
FORM convert_spool_to_pdf1.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att1 = gd_buffer.
APPEND it_mess_att1.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
FORM process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
DESCRIBE TABLE it_mess_att1 LINES gd_recsize1.
CHECK gd_recsize > 0 or gd_recsize1 > 0.
PERFORM send_email." USING p_email1.
perform send_email using p_email2.
ENDFORM.
FORM send_email *
--> p_email *
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 = gd_attachment_desc1 .
gd_attachment_desc = 'YPP18 - Daily Highlights'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Dear Sir,'.
APPEND it_mess_bod.
it_mess_bod = ' '.
APPEND it_mess_bod.
it_mess_bod = ' '.
APPEND it_mess_bod.
it_mess_bod = 'kindly find the attached document'.
APPEND it_mess_bod.
it_mess_bod = ' '.
APPEND it_mess_bod.
it_mess_bod = 'Do not reply on this mail, It is generated from SAP'.
APPEND it_mess_bod.
it_mess_bod = ' '.
APPEND it_mess_bod.
it_mess_bod = ' '.
APPEND it_mess_bod.
it_mess_bod = 'Regards,'.
APPEND it_mess_bod.
it_mess_bod = 'Arpit Shah'.
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
it_mess_att1
using "p_email
gd_mtitle
'Testing mail generated from SAP'
'Daily Highlights Abstract Report - YPP18'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables it_message
it_attach
it_attach1
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,w_doc_data1 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_data1-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[].
For 2nd Attachments
* Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach1 INDEX w_cnt.
w_doc_data-doc_size = w_doc_data1-doc_size +
( w_cnt - 1 ) * 255 + STRLEN( it_attach1 ).
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.
APPEND LINES OF it_attach1 to t_attachment.
t_attachment[] = it_attach1[].
APPEND LINES OF it_attach1 to t_attachment.
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 = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
DESCRIBE TABLE it_mess_att LINES t_packing_list-body_num.
DESCRIBE TABLE it_attach LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = 'YMIS008'."ld_attdescription.
t_packing_list-obj_name = 'YMIS008'."ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
clear t_packing_list.
for 2 attachments
data : a type i,b type i.
a = t_packing_list-body_num.
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = a + 1. "1
DESCRIBE TABLE it_mess_att1 LINES t_packing_list-body_num.
DESCRIBE TABLE it_attach1 LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = 'YMIS10'."ld_attdescription.
t_packing_list-obj_name = 'YMIS10'."ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
a = t_packing_list-body_num.
clear 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 = a + 1.
t_packing_list-body_num = t_packing_list-body_num + 1.
DESCRIBE TABLE it_mess_att1 LINES t_packing_list-body_num.
t_packing_list-body_num = a + t_packing_list-body_num .
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = 'YMIS10'."ld_attdescription.
t_packing_list-obj_name = 'YMIS10'."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.
loop at ymis008tab into mailstr.
t_receivers-receiver = mailstr-p_email. "ld_email.
t_receivers-receiver = p_email1.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'. "X "Read Acknoledgement
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
endloop.
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.
Rgds.
ArpitHi Arpit,
Take a look at the documentation of FM 'SO_DOCUMENT_SEND_API1' for parameter PACKING_LIST. I think you should set t_packing_list-head_num to a different value than 0 for the second attachment.
Regards,
John. -
Send a mail with the class CL_HTTP_CLIENT
hi,
i use this program and i would send a mail with a attachment file PDF. I try to use the function module SO_NEW_DOCUMENT_ATT_SEND_API1 but i dont know to translate the data XSTRING to internal table.
Thank you.
*& Report ZYTEST_TRANSFER_URL2 *
REPORT zytest_transfer_url2 .
*- begin of internal data
TYPE-POOLS: swfxc, icon.
DATA: l_http_client TYPE REF TO if_http_client.
DATA: l_url TYPE string.
DATA: l_code TYPE sy-subrc.
DATA: l_code_string TYPE string.
DATA: l_message_string TYPE string.
DATA: lt_http_fields TYPE tihttpnvp.
DATA: l_http_field_wa TYPE ihttpnvp.
DATA: l_char_header(40) TYPE c.
DATA: l_body_string TYPE string.
DATA : line TYPE string.
DATA: result_tab TYPE TABLE OF string,
result_str TYPE string.
*- end of internal data
DATA: lv_contents TYPE string.
DATA: lv_location TYPE string.
*- begin of parameters
PARAMETERS: url TYPE swc_value.
PARAMETERS : receiver TYPE somlreci1-receiver LOWER CASE.
*- end of parameters
START-OF-SELECTION.
PERFORM main.
*& Form main
text
FORM main.
PERFORM get_contents USING lv_contents.
*- Create the HTTP-Client
l_url = url.
l_proxy_host =
l_proxy_service =
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = l_url
proxy_host = l_proxy_host
proxy_service = l_proxy_service
IMPORTING
client = l_http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*- send the http post
CALL METHOD l_http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
IF sy-subrc <> 0.
WRITE: / icon_red_light AS ICON.
CALL METHOD l_http_client->get_last_error
IMPORTING
code = l_code
MESSAGE = l_message_string.
CALL METHOD l_http_client->close.
l_code_string = l_code.
CONCATENATE 'HTTP-Send: RC=' l_code_string "#EC NOTEXT
INTO l_code_string .
CONCATENATE l_code_string l_message_string
INTO l_message_string SEPARATED BY space.
PERFORM print_string USING l_message_string.
EXIT.
ENDIF.
*- receive the result of http post
CALL METHOD l_http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
IF sy-subrc <> 0.
WRITE: / icon_red_light AS ICON.
CALL METHOD l_http_client->get_last_error
IMPORTING
code = l_code
MESSAGE = l_message_string.
CALL METHOD l_http_client->close.
l_code_string = l_code.
CONCATENATE 'HTTP-Receive: RC=' l_code_string "#EC NOTEXT
INTO l_code_string .
CONCATENATE l_code_string l_message_string
INTO l_message_string SEPARATED BY space.
PERFORM print_string USING l_message_string.
EXIT.
ENDIF.
*- print the results
CALL METHOD l_http_client->response->get_status
IMPORTING
code = l_code.
IF l_code < 300.
HTTP-codes: 100 - 199 = informations
HTTP-codes: 200 - 299 = client-request successful (200 = OK)
WRITE: / icon_green_light AS ICON.
ELSE.
HTTP-codes: 300 - 399 = redirected; further actions required
HTTP-codes: 400 - 499 = client-request incomplete
HTTP-codes: 500 - 599 = server errors
WRITE: / icon_red_light AS ICON.
ENDIF.
*-- get the http header fields
CALL METHOD l_http_client->response->get_header_fields
CHANGING
fields = lt_http_fields.
LOOP AT lt_http_fields INTO l_http_field_wa.
l_char_header = l_http_field_wa-name.
WRITE: / l_char_header.
l_char_header = l_http_field_wa-value.
WRITE: l_char_header.
ENDLOOP.
WRITE: / sy-uline.
*- get the body
DATA: lv_bin_contents TYPE xstring.
lv_bin_contents = l_http_client->response->get_data( ).
PERFORM save_file USING lv_bin_contents.
ENDFORM. "main
*& Form print_string
FORM print_string USING p_string TYPE string.
REFRESH result_tab.
SPLIT p_string AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab.
LOOP AT result_tab INTO result_str.
WRITE:/ result_str.
ENDLOOP.
ENDFORM. " print_string
*& Form save_file
text
FORM save_file USING lv_bin_contents.
DATA: save_file(1000) TYPE c VALUE '/tmp/test3.pdf'.
DATA: lv_file TYPE localfile.
DATA : g_file(80).
g_file = url.
DO.
SHIFT g_file LEFT UP TO '/'.
IF sy-subrc NE 0.
EXIT.
ENDIF.
SHIFT g_file LEFT.
ENDDO.
SHIFT g_file RIGHT UP TO '.'.
SHIFT g_file RIGHT.
lv_file = save_file.
OPEN DATASET lv_file FOR OUTPUT IN BINARY MODE.
IF sy-subrc NE 0.
WRITE:'SY-SUBRC :',sy-subrc.
MESSAGE i000 WITH text-014. "'File Directory not found'.
EXIT.
ENDIF.
TRANSFER lv_bin_contents TO lv_file.
CLOSE DATASET lv_file.
IF sy-subrc <> 0.
EXIT.
ENDIF.
IF sy-subrc EQ 0.
MESSAGE i000 WITH text-012."'Successfully downloaded to Application
server'.
EXIT.
ENDIF.
ENDFORM. "save_filehi,
i use this program and i would send a mail with a attachment file PDF. I try to use the function module SO_NEW_DOCUMENT_ATT_SEND_API1 but i dont know to translate the data XSTRING to internal table.
Thank you.
*& Report ZYTEST_TRANSFER_URL2 *
REPORT zytest_transfer_url2 .
*- begin of internal data
TYPE-POOLS: swfxc, icon.
DATA: l_http_client TYPE REF TO if_http_client.
DATA: l_url TYPE string.
DATA: l_code TYPE sy-subrc.
DATA: l_code_string TYPE string.
DATA: l_message_string TYPE string.
DATA: lt_http_fields TYPE tihttpnvp.
DATA: l_http_field_wa TYPE ihttpnvp.
DATA: l_char_header(40) TYPE c.
DATA: l_body_string TYPE string.
DATA : line TYPE string.
DATA: result_tab TYPE TABLE OF string,
result_str TYPE string.
*- end of internal data
DATA: lv_contents TYPE string.
DATA: lv_location TYPE string.
*- begin of parameters
PARAMETERS: url TYPE swc_value.
PARAMETERS : receiver TYPE somlreci1-receiver LOWER CASE.
*- end of parameters
START-OF-SELECTION.
PERFORM main.
*& Form main
text
FORM main.
PERFORM get_contents USING lv_contents.
*- Create the HTTP-Client
l_url = url.
l_proxy_host =
l_proxy_service =
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = l_url
proxy_host = l_proxy_host
proxy_service = l_proxy_service
IMPORTING
client = l_http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*- send the http post
CALL METHOD l_http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
IF sy-subrc <> 0.
WRITE: / icon_red_light AS ICON.
CALL METHOD l_http_client->get_last_error
IMPORTING
code = l_code
MESSAGE = l_message_string.
CALL METHOD l_http_client->close.
l_code_string = l_code.
CONCATENATE 'HTTP-Send: RC=' l_code_string "#EC NOTEXT
INTO l_code_string .
CONCATENATE l_code_string l_message_string
INTO l_message_string SEPARATED BY space.
PERFORM print_string USING l_message_string.
EXIT.
ENDIF.
*- receive the result of http post
CALL METHOD l_http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
IF sy-subrc <> 0.
WRITE: / icon_red_light AS ICON.
CALL METHOD l_http_client->get_last_error
IMPORTING
code = l_code
MESSAGE = l_message_string.
CALL METHOD l_http_client->close.
l_code_string = l_code.
CONCATENATE 'HTTP-Receive: RC=' l_code_string "#EC NOTEXT
INTO l_code_string .
CONCATENATE l_code_string l_message_string
INTO l_message_string SEPARATED BY space.
PERFORM print_string USING l_message_string.
EXIT.
ENDIF.
*- print the results
CALL METHOD l_http_client->response->get_status
IMPORTING
code = l_code.
IF l_code < 300.
HTTP-codes: 100 - 199 = informations
HTTP-codes: 200 - 299 = client-request successful (200 = OK)
WRITE: / icon_green_light AS ICON.
ELSE.
HTTP-codes: 300 - 399 = redirected; further actions required
HTTP-codes: 400 - 499 = client-request incomplete
HTTP-codes: 500 - 599 = server errors
WRITE: / icon_red_light AS ICON.
ENDIF.
*-- get the http header fields
CALL METHOD l_http_client->response->get_header_fields
CHANGING
fields = lt_http_fields.
LOOP AT lt_http_fields INTO l_http_field_wa.
l_char_header = l_http_field_wa-name.
WRITE: / l_char_header.
l_char_header = l_http_field_wa-value.
WRITE: l_char_header.
ENDLOOP.
WRITE: / sy-uline.
*- get the body
DATA: lv_bin_contents TYPE xstring.
lv_bin_contents = l_http_client->response->get_data( ).
PERFORM save_file USING lv_bin_contents.
ENDFORM. "main
*& Form print_string
FORM print_string USING p_string TYPE string.
REFRESH result_tab.
SPLIT p_string AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab.
LOOP AT result_tab INTO result_str.
WRITE:/ result_str.
ENDLOOP.
ENDFORM. " print_string
*& Form save_file
text
FORM save_file USING lv_bin_contents.
DATA: save_file(1000) TYPE c VALUE '/tmp/test3.pdf'.
DATA: lv_file TYPE localfile.
DATA : g_file(80).
g_file = url.
DO.
SHIFT g_file LEFT UP TO '/'.
IF sy-subrc NE 0.
EXIT.
ENDIF.
SHIFT g_file LEFT.
ENDDO.
SHIFT g_file RIGHT UP TO '.'.
SHIFT g_file RIGHT.
lv_file = save_file.
OPEN DATASET lv_file FOR OUTPUT IN BINARY MODE.
IF sy-subrc NE 0.
WRITE:'SY-SUBRC :',sy-subrc.
MESSAGE i000 WITH text-014. "'File Directory not found'.
EXIT.
ENDIF.
TRANSFER lv_bin_contents TO lv_file.
CLOSE DATASET lv_file.
IF sy-subrc <> 0.
EXIT.
ENDIF.
IF sy-subrc EQ 0.
MESSAGE i000 WITH text-012."'Successfully downloaded to Application
server'.
EXIT.
ENDIF.
ENDFORM. "save_file -
Internal Server Error while sending mail with extended property
I am using EWS Managed API. I just started fiddling with Extended properties. So I wrote simple code to send a simple mail with extended property attached to it.
Forming the mail part I simply copy pasted from this
MSDN page. For testing purpose I suppressed certificate validations.
This is my complete code:
1 ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
2 service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
3 service.TraceListener = new TraceListener();
4 service.TraceEnabled = false;
5
6 service.Credentials = new WebCredentials("[email protected]", "password@123");
7 service.Url = new Uri("https://exchng.domain.com/EWS/Exchange.asmx");
8
9 Guid MyPropertySetId = new Guid("{C11FF724-AA03-4555-9952-8FA248A11C3E}");
10
11 // Create a definition for the extended property.
12 ExtendedPropertyDefinition extendedPropertyDefinition = new ExtendedPropertyDefinition(MyPropertySetId, "Expiration Date", MapiPropertyType.String);
13
14 // Create an e-mail message that you will add the extended property to.
15 EmailMessage message = new EmailMessage(service);
16 message.Subject = "Saved with extendedPropertyDefinition of two days";
17 message.Body = "The expiration date is contained within the extended property.";
18 message.ToRecipients.Add("[email protected]");
19
20 // Add the extended property to an e-mail message object named "message".
21 message.SetExtendedProperty(extendedPropertyDefinition, DateTime.Now.AddDays(2).ToString());
22
23 // Save the e-mail message.
24 message.SendAndSaveCopy();
Please find the rest of the question in first reply, as I got "Body must be 4 to 60000 characters long".Rest of the question:
I am getting below exception (with no nested inner exceptions) on line 24:
An internal server error occurred. The operation failed.
at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary()
at Microsoft.Exchange.WebServices.Data.ServiceResponse.ThrowIfNecessary()
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalCreateItems(IEnumerable`1 items, FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode, ServiceErrorHandling errorHandling)
at Microsoft.Exchange.WebServices.Data.ExchangeService.CreateItem(Item item, FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode)
at Microsoft.Exchange.WebServices.Data.Item.InternalCreate(FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode)
at Microsoft.Exchange.WebServices.Data.EmailMessage.InternalSend(FolderId parentFolderId, MessageDisposition messageDisposition)
at Microsoft.Exchange.WebServices.Data.EmailMessage.SendAndSaveCopy()
If I comment line number 21, the code works fine and sends the message. So why it fails with extended properties? -
Hi-
I found a contact form for my Flash website but it's not working properly. It uses ActionScript 3 and PHP, both of which I don't know much about. Because of this, I can't pinpoint the problem or how to fix it. Here's what's going on:
1) Each field in the form only allows 3 characters and no special characters such as @ _ ! . , etc...
2) When the user goes to the next field in the form, the previous field appears blank but the when clicking on that again, the original text appears.
3) When submitting the form, it just keeps saying "in progress" and never shows the confirmation text nor does the email get sent. There is an HTML file included with this form but I am not sure if I need to put that in as I have embedded this form into an SWF file so I don't think I need that code but please let me know if I am wrong about this.
I am posting both the AS code and PHP code below.. if someone can help me figure this out I would greatly appreciate it. I am not sure which file the problem is in. If someone here doesn't know PHP then at least see the AS code and let me know if the problem is in that or not. That way I can pinpoint which file the problem is coming from and then seek further help if needed. To see the form in action, go here: http://www.poojasdesigns.com/ and click on "Contact Me".. here are the codes:
ActionScript 3.0
//presistant reference to this movie's mail timeline:
var mainTL:MovieClip = this;
//start off with submit button dimmed
submit_mc._alpha = 40;
//create the LoadVars objects which will be used later
//one to send the data...
var dataSender:LoadVars = new LoadVars();
//and one to recieve what comes back
var dataReceiver:LoadVars = new LoadVars();
create listener for Key Object
this is just a U.I. thing - "wakes up" the submit button
when all fields have at least some content
var formCheck:Object = new Object();
formCheck.onKeyUp = function() {
if (name_txt.text != '' &&
email_txt.text != '' &&
subject_txt.text != '' &&
message_txt.text != '') {
//clear any alert messages
alert_txt.text = '';
//enable the submit button
submit_mc._alpha = 100;
} else {
//remain disabled until all fields have content
submit_mc._alpha = 40;
Key.addListener(formCheck);
/*#######SET STYLES FOR TEXT FIELDS#######*/
//define styles for both normal and focussed
//set hex values here that work with your site's colors
var normal_border:Number = 0x000000;
var focus_border:Number = 0xFA8D00;
var normal_background:Number = 0xFFFFFF;
var focus_background:Number = 0xE9E3E3;
var normal_color:Number = 0xFFFFFF;
var focus_color:Number = 0x000000;
//create an array containing the fields we wish to have styles applied to
inputs=[name_txt,email_txt,subject_txt,message_txt];
a "for in" loop now iterates through each element in the "inputs" array
and applies our "normal" formatting to each input text field
for( var elem in inputs) {
inputs[elem].border = true;
inputs[elem].borderColor = normal_border;
inputs[elem].background = true;
inputs[elem].backgroundColor = normal_background;
inputs[elem].textColor = normal_color;
/*this takes care of applying the "normal" style to each of the four input fields;
the following TextField prototypes handle highlighting when an input field
gains focus and resetting to normal when a field loses focus*/
inputs[elem].onSetFocus = function() {
this.borderColor = focus_border;
this.backgroundColor = focus_background;
this.textColor = focus_color;
inputs[elem].onKillFocus = function() {
this.borderColor = normal_border;
this.backgroundColor = normal_background;
this.textColor = normal_color;
//finally: make the first field (name_txt) selected when the movie loads
Selection.setFocus(name_txt);
/*DEFINE SUBMIT BUTTON BEHAVIOR*/
submit_mc.onRelease = function() {
//final check to make sure fields are completed
if (name_txt.text != '' &&
email_txt.text != '' &&
subject_txt.text != '' &&
message_txt.text != '') {
alert_txt.text='';//clear any previous error messages or warnings
//advance playhead to frame 2 - the "processing" message
mainTL.play();
//assign properties to LoadVars object created previously
dataSender.name = name_txt.text;
dataSender.email = email_txt.text;
dataSender.subject = subject_txt.text;
dataSender.message = message_txt.text;
//callback function - how to handle what comes abck
dataReceiver.onLoad = function() {
if (this.response == "invalid") {
mainTL.gotoAndStop(1);
alert_txt.text = "Please verify your email address - it appears to be incorrect."
} else if (this.response == "passed") {
mainTL.gotoAndStop(4);
//now send data to script
NOTE: the line below presumes the Flash swf file and php script are in the
SAME DIRECTORY on your server. If this is not the case (if for example you
wish to put the php script along with other similar items in a "scripts"
directory) you MUST MODIFY THE PATH. Otherwise the Flash movie won't be
able to locate the php script.
dataSender.sendAndLoad("processEmail.php", dataReceiver, "POST");
} else {
//warning if they try to submit before completing
alert_txt.text = "Please fill out all the fields before submitting the form.";
PHP
<?php
//create short variable names
$name=$_POST['name'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['message'];
$name=trim($name);
$email=trim($email);
$subject=StripSlashes($subject);
$message=StripSlashes($message);
/*my email address - dummy address inserted for privacy in this forum*/
$toaddress='[email protected]';
if (preg_match ("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i", $email)) {
mail($toaddress,$subject,$message,"From: $name <$email>\r\nReply-To: $email\r\nReturn-Path: $email\r\n");
//clear the variables
$name='';
$email='';
$subject='';
$message='';
echo "response=passed";
else {
echo "response=invalid";
exit;
?>
Please let me know how to proceed. Thanks so much!
*Pooja*You say you don't know much about AS3, and that you have embedded this form into an swf. In what manner did you embed it, and what version of AS does the swf use? Have you tried using the form in the page that was provided as a standalone test to see if it works?
-
Who can help me with this form?
Having some problems with the form ive placed on my site.
I cant find the problem. Is there someone who can tell me what i have done wrong.
you can see the form on.
http://www.salontouche.nl/explorers.htm
and the error i get is..
Oops! This page appears broken. DNS Error - Server cannot be found.
hope to get some advice..
this is the contactscript..
<?php error_reporting(0);
// VALUES FROM THE FORM
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['msg'];
// ERROR & SECURITY CHECKS
if ( ( !$email ) ||
( strlen($_POST['email']) > 200 ) ||
( !preg_match("#^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)* )\.([A-Za-z]{2,})$#", $email) )
print "Error: Invalid E-Mail Address";
exit;
if ( ( !$name ) ||
( strlen($name) > 100 ) ||
( preg_match("/[:=@\<\>]/", $name) )
print "Error: Invalid Name";
exit;
if ( preg_match("#cc:#i", $message, $matches) )
print "Error: Found Invalid Header Field";
exit;
if ( !$message )
print "Error: No Message";
exit;
if ( strpos($email,"\r") !== false || strpos($email,"\n") !== false ){
print "Error: Invalid E-Mail Address";
exit;
if (FALSE) {
print "Error: You cannot send to an email address on the same domain.";
exit;
// CREATE THE EMAIL
$headers = "Content-Type: text/plain; charset=iso-8859-1\n";
$headers .= "From: $name <$email>\n";
$recipient = "[email protected]";
$subject = "Reactie van uw Website";
$message = wordwrap($message, 1024);
// SEND THE EMAIL TO YOU
mail($recipient, $subject, $message, $headers);
// REDIRECT TO THE THANKS PAGE
header("Location: http://www.salontouche.nl/thanks.php");
?>
regardsHaving some problems with the form ive placed on my site.
I cant find the problem. Is there someone who can tell me what i have done wrong.
you can see the form on.
http://www.salontouche.nl/explorers.htm
and the error i get is..
Oops! This page appears broken. DNS Error - Server cannot be found.
hope to get some advice..
this is the contactscript..
<?php error_reporting(0);
// VALUES FROM THE FORM
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['msg'];
// ERROR & SECURITY CHECKS
if ( ( !$email ) ||
( strlen($_POST['email']) > 200 ) ||
( !preg_match("#^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)* )\.([A-Za-z]{2,})$#", $email) )
print "Error: Invalid E-Mail Address";
exit;
if ( ( !$name ) ||
( strlen($name) > 100 ) ||
( preg_match("/[:=@\<\>]/", $name) )
print "Error: Invalid Name";
exit;
if ( preg_match("#cc:#i", $message, $matches) )
print "Error: Found Invalid Header Field";
exit;
if ( !$message )
print "Error: No Message";
exit;
if ( strpos($email,"\r") !== false || strpos($email,"\n") !== false ){
print "Error: Invalid E-Mail Address";
exit;
if (FALSE) {
print "Error: You cannot send to an email address on the same domain.";
exit;
// CREATE THE EMAIL
$headers = "Content-Type: text/plain; charset=iso-8859-1\n";
$headers .= "From: $name <$email>\n";
$recipient = "[email protected]";
$subject = "Reactie van uw Website";
$message = wordwrap($message, 1024);
// SEND THE EMAIL TO YOU
mail($recipient, $subject, $message, $headers);
// REDIRECT TO THE THANKS PAGE
header("Location: http://www.salontouche.nl/thanks.php");
?>
regards -
Problem in excel format while sending mail with excel attachment.
Hi Gurus ,
I am sending a email with Excel attachment using FM SO_DOCUMENT_SEND_API1 or SO_NEW_DOCUMENT_ATT_SEND_API1.
I am able to send a mail with excel attachment with a piece of code which I got from SDN itself.
But the problem is when I am trying to open the attachment, <b>A pop up comes which says that it is not in recognizable format. Would you like to open it?
and several other lines of caution.</b>
When i choose to open it, i get the correct data in one excel sheet. Certain vertical lines of the excel sheet is missing. <b>But no data is missing. </b>
I am attaching the code below. Can any one please tell me where is the problem in this code ?
Thanx in advance
types: begin of t_mara,
matnr type mara-matnr,
matkl type mara-matkl,
mtart type mara-mtart,
meins type mara-meins,
end of t_mara.
data: gt_mara type table of t_mara,
wa_mara like line of gt_mara,
it_packing_list type table of SOPCKLSTI1,
wa_packing_list like line of it_packing_list,
it_receivers type table of SOMLRECI1,
wa_receivers like line of it_receivers,
it_mailbody type table of SOLISTI1,
wa_mailbody like line of it_mailbody,
it_attachment type table of SOLISTI1,
wa_attachment like line of it_attachment.
data: la_doc type SODOCCHGI1.
constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
* get material
select matnr matkl mtart meins
into table gt_mara
from mara
up to 25 rows.
* Populate the subject/generic message attributes
la_doc-obj_langu = sy-langu.
la_doc-obj_descr = 'Material Details' . "Mail Header
la_doc-sensitivty = 'F'.
la_doc-doc_size = 1.
* Add the recipients email address
CLEAR wa_receivers.
REFRESH it_receivers.
wa_receivers-receiver = 'PCSDEVL'.
wa_receivers-rec_type = 'U'.
wa_receivers-com_type = 'INT'.
wa_receivers-notif_del = 'X'.
wa_receivers-notif_ndel = 'X'.
APPEND wa_receivers to it_receivers.
* Mail Body
CLEAR wa_mailbody.
REFRESH it_mailbody.
wa_mailbody-line = 'Please find the attachment'.
APPEND wa_mailbody to it_mailbody.
* Mail attachmwnt
CLEAR wa_attachment.
REFRESH it_attachment.
CONCATENATE 'MATNR' 'MATKL' 'MTART' 'MEINS'
INTO wa_attachment SEPARATED BY con_tab.
CONCATENATE con_cret wa_attachment INTO wa_attachment.
APPEND wa_attachment to it_attachment.
LOOP AT gt_mara INTO wa_mara.
CONCATENATE wa_mara-matnr wa_mara-matkl
wa_mara-mtart wa_mara-meins
INTO wa_attachment SEPARATED BY con_tab.
CONCATENATE con_cret wa_attachment INTO wa_attachment.
APPEND wa_attachment to it_attachment.
ENDLOOP.
* Describe the body of the message
CLEAR wa_packing_list.
REFRESH it_packing_list.
wa_packing_list-transf_bin = space.
wa_packing_list-head_start = 1.
wa_packing_list-head_num = 0.
wa_packing_list-body_start = 1.
wa_packing_list-body_num = 1.
wa_packing_list-doc_type = 'RAW'.
APPEND wa_packing_list to it_packing_list.
* Create attachment notification
wa_packing_list-transf_bin = 'X'.
wa_packing_list-head_start = 1.
wa_packing_list-head_num = 1.
wa_packing_list-body_start = 1.
DESCRIBE TABLE it_attachment LINES wa_packing_list-body_num.
wa_packing_list-doc_type = 'XLS'. " To word attachment change this as 'DOC'
wa_packing_list-obj_descr = ' '.
concatenate wa_packing_list-doc_type 'file' into wa_packing_list-OBJ_DESCR
separated by space.
wa_packing_list-doc_size = wa_packing_list-body_num * 255.
APPEND wa_packing_list to it_packing_list.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = la_doc
PUT_IN_OUTBOX = 'X'
* SENDER_ADDRESS = SY-UNAME
* SENDER_ADDRESS_TYPE = 'B'
COMMIT_WORK = 'X'
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
* SENDER_ID =
tables
packing_list = it_packing_list
* OBJECT_HEADER =
CONTENTS_BIN = it_attachment
CONTENTS_TXT = it_mailbody
* 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.REPORT Zex5 LINE-SIZE 255 LINE-COUNT 255 .
class CL_ABAP_CHAR_UTILITIES definition load. "-->
TABLES : vbap.
SELECT-OPTIONS: s_vbeln FOR vbap-vbeln.
DATA : BEGIN OF itab OCCURS 1,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
matnr LIKE vbap-matnr,
END OF itab.
parameters : p_email like somlreci1-receiver
DATA: tlines type i.
DATA: itmessage LIKE solisti1 OCCURS 1 WITH HEADER LINE. "Ok
DATA: itattach LIKE solisti1 OCCURS 2 WITH HEADER LINE. "Ok
DATA: itpacklist LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
DATA: itreclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
data: itattachment like solisti1 OCCURS 2 WITH HEADER LINE.
start-of-selection.
SELECT vbeln posnr matnr
FROM vbap
INTO TABLE itab
WHERE vbeln IN s_vbeln.
**Make the internal table data to be compatible in excel format .
PERFORM BUILD_XLS_FORMAT.
**Populate message of body text.
clear itmessage.
refresh itmessage.
itmessage = 'Please find attached Excel file'.
append itmessage.
PERFORM send_mail_as_xls_attachment tables itmessage
itattach
using p_email 'Excel Attachment' 'TXT' " 'XLS'
using p_email 'TEXT Attachment' 'TXT' " 'XLS'
'TestFileName'
'SalesOrders' .
*& Form BUILD_XLS_FORMAT
text
--> p1 text
<-- p2 text
form BUILD_XLS_FORMAT.
previosuly we were using for unicode ..now replaced
**Declare constants for the spacing .
*Constants : con1 type x value '0D',
con2 type x value '09'.
Constants : con1 type c
value CL_ABAP_CHAR_UTILITIES=>CR_LF,
con2 type c
value CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
**For the Header descriptions.
Concatenate 'SalesORdNo'
'Item'
'Materialno' into itattach separated by con2.
Concatenate con1 itattach into itattach.
Append itattach.
**Now align the items in the itab as above .
Loop at Itab.
concatenate itab-vbeln
itab-posnr
itab-matnr into itattach separated by con2.
concatenate con1 itattach into itattach .
Append itattach.
endloop.
endform. " BUILD_XLS_FORMAT
*& Form send_mail_as_xls_attachment
text
-->P_ITMESSAGE text
-->P_ITATTACH text
-->P_P_EMAIL text
-->P_0116 text
-->P_0117 text
-->P_0118 text
-->P_0119 text
form send_mail_as_xls_attachment tables p_itmessage
p_itattach
using p_email
p_mtitle
p_format
p_filename
p_attdescription.
Data : xdocdata like sodocchgi1,
xcnt type i.
*Fill the document data.
xdocdata-doc_size = 1.
*Populate the subject/generic message attributes.
xdocdata-obj_name = 'SAPRPT'.
xdocdata-obj_langu = sy-langu.
xdocdata-obj_descr = p_mtitle.
*Fill the document data and fetch size of attachment.
clear xdocdata.
read table itattach index xcnt.
xdocdata-doc_size = ( xcnt - 1 ) * 255 + strlen( itattach ).
xdocdata-doc_size = ( xcnt - 1 ) * 255.
xdocdata-obj_name = 'SAPRPT'.
xdocdata-obj_langu = sy-langu.
xdocdata-obj_descr = p_mtitle.
clear itattachment. refresh itattachment.
itattachment[] = p_itattach[].
*Describe the body of the message.
clear itpacklist. refresh itpacklist.
itpacklist-transf_bin = 'X'.
itpacklist-head_start = '1'.
itpacklist-head_num = '0'.
itpacklist-body_start = '1'.
describe table itattachment lines itpacklist-body_num .
itpacklist-doc_type = 'TXT'.
itpacklist-doc_type = 'XLS'.
append itpacklist.
*Create attachment notification.
itpacklist-transf_bin = 'X'.
itpacklist-head_start = '1'.
itpacklist-head_num = '1'.
itpacklist-body_start = '1'.
describe table itattachment lines itpacklist-body_num .
itpacklist-doc_type = p_format.
itpacklist-obj_name = p_filename.
itpacklist-obj_descr = p_attdescription.
itpacklist-doc_size = itpacklist-body_num * 255 .
append itpacklist.
*FIll the receivers list.
Clear itreclist. refresh itreclist.
itreclist-receiver = p_email.
itreclist-rec_type = 'U'.
itreclist-com_type = 'INT'.
itreclist-notif_del = 'X'.
itreclist-notif_ndel = 'X'.
*itreclist-notif_read = 'X'.
append itreclist.
*CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = xdocdata
PUT_IN_OUTBOX = 'X'
commit_work = 'X'
SENDER_ADDRESS = SY-UNAME
tables
packing_list = itpacklist
CONTENTS_BIN = itattachment
CONTENTS_TXT = itmessage
receivers = itreclist
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.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = xdocdata
PUT_IN_OUTBOX = 'X'
TABLES
packing_list = itpacklist
CONTENTS_BIN = itattachment
CONTENTS_TXT = itmessage
receivers = itreclist
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. " send_mail_as_xls_attachment
Just execute the above code and let me know.
What is the sap version u r using .
Vijay
Maybe you are looking for
-
Issue while generating a CSV file through Oracle.
Hi, I am generating a CSV file using oracle stored procedure. In an Oracle procedure I need to create a CSV file, which contains the data of a select query, and then emailing this file. Problem is that one of the field contains comma eg ('ABC,DE'). N
-
I have been getting a pattern of errors on my DC. I have two pair of eyes on these errors, but everything seems to running ok. The only issue we've had is our workstations were putting out the "Trust domain relationship failed..." error. We were able
-
Flex pitch (Time) needs midi track import function
Flex pitch (Time) needs midi track import function
-
IPod mini reboots every time I turn it on
As of late, my 2nd gen. iPod mini has been acting up. It seems when I don't use it for longer than a few hours, it reboots when I turn it on. By reboots I mean it takes a few seconds showing nothing and then the apple sign comes on. Shortly after tha
-
GridBagLayout on top of other layout manager
Hi, I am trying to put a GridBagLayout within a GridLayout and it is not showing up. What's wrong? Thanks, Steve import java.awt.*; import java.awt.event.*; import javax.swing.*; class TestButton { public static void main(String[] arguments) {