Mail Freezes --corrupt attachment?
Suddenly Mail stopped working.
I see the list of messages. If I try to open one or two or even just delete a few, the phone freezes after a few minutes and I have to reboot. Other applications seem to be working ok. I know I have a message with a large attachment.
Is there any way to delete all email messages without completely erasing the phone?
Try deleting the Mail account and re-creating it to begin with.
Though the other thing to be aware of is to watch for the spinning loading icon at the top and also at the bottom of the screen i have had some mail take ages to load as they had very large attachments and i thought the iPhone had frozen but it was actually doing sonmething just due to the size of the attachments it took quite a while.
Similar Messages
-
Mail freezes when attach using icon and dialog box, but OK with drag attach
Everthing else on my mail is working fine, but when I try to use the "Attach" icon on a new or reply message, the finder dialog box comes up, and then mail freezes with the spinning ball. Alternatively, if I drag and drop a file to the new mail window, it works fine. Also, if I right click (CTRL-click) on a file, and select "Open With -> Mail" That also works fine.
My suspicion of the problem is that the attach file dialog box keeps defaulting to open files in a folder that was in a link that's no longer available (deleted link), and it freezes things up. Because it always opens up to the same folder, and that's where it freezes, without showing any files in that folder.
Thank you for your help!Verify/repair the startup disk (not just permissions), as described here:
The Repair functions of Disk Utility: what's it all about?
Go to Apple Menu > System Preferences > Network, choose Network Port Configurations from the Show popup menu, and make sure that the configuration used to connect to Internet appears at the top of the list. Leave checked (enabled) only the port configuration needed to connect to Internet and Built-in Ethernet (in that order if not the same). Uncheck (disable) the rest. Parallels in particular, if you have that installed, is known to cause this problem in Mail. -
Mail freezes while attaching file in Maverick
Problem: When I attempt to attach a file in Mail it freezes and is not reponsive. It requires me to force quit the program.
Background: I just upgraded to OS X Maverick yesterday (10-24). Prior to this upgrade I did not have this problem. Mail ran great! The specific file I was attempting to attach was a 3.5MB video (Apple Quicktime MP4) file. I also attempted to attached a 3k txt file and it also froze the program. This happens each and every time I try no matter which e-mail account I am on.
Specs: Mac Pro Workstation, 2 x 3.2 GHz Quad-Core Intel Xeon, 6GB 800 MHz DDR2 FB-DIMM
Can anyone suggest a fix? Thank you.jde, I found some advice on other threads. I am posting this here in case it can help you or anyone else.
I disabled (unclicked) saving mail to the servers in the Mail Account preferences for all of my different accounts. I went into internet preferences (in system preferences) and made sure all account were enabled (you may have to approve the passwords being sent despite the security warning... the window said I would have to re-enter the passwords, but I did not have to do so). And then in Terminal I typed the following:
defaults delete com.apple.mail ColorQuoterColorList
In my case it said not found, but I deleted the "ColorQuoterColorList" part and it seemed to work. I hope this helps. Mail seems to be working for now, and even seems a bit snappier.
Regarding Safari, I found advice to go through and clear out various PlugIns from the User Library Internet PlugIns folder and the System Library Plugins folder. I cleared out the old plugins that seem barely to be used, and updated some of the others, and this has seemed to help. Safari is now responsive. I saved all Plugins to folders on my desktop just to be sure I was not dumping something I might want to use. (I assume you know how to get into your user Library... hold down the option key while you click on the "Go" menu in the finder to see it). -
Mac Mail Freezes when attaching files
Ever since my upgrade to snow leopard, my mac mail does 2 things. 1, it keeps asking for my name and password, and I have already cleared out my keychain, re input all my information, and it keeps doing that. does it about once a day.
but my more detrimental problem is that my mail will freeze the entire freaking system if I try to attach a file! Used to, I didn't have this issue, and it's only doing it on my imac. I have snow leopard on my macbook and it works just fine when I attach a file. On top of that, it's doing it when I attach a mp3.
I am not sure what to try here. But it doesn't just freeze up mail, but the entire mac. I mean, I can't even do a Command Option Esc to close mail, because it locks up the entire freaking system. I don't know what to try here.I would start by setting up another user account, set up mail.app with your info on that account and see what happens there. If everything works fine there, I would (in the normal account) export all messages etc in mail.app (and make sure you have backup), delete (or rather rename) all mail prefs etc and set the mail.app up again and then (when everything hopefully works) import all old messages.
Btw, I assume that you have repaired permissions on the disk and that "cleared out the keychain" also included doing a first aid repair for the keychain. -
Mail freezes when attaching file
I suddenly can't attach files to mail that I'm sending. The mail program freezes and I have to force quit (it says "mail not responding" in force quit box). I can still send mail if there are no attachments. Anyone know what to do?
Hi Lessa,
Could be many things, we should start with this for safety...
"Try Disk Utility
1. Insert the Mac OS X Install disc that came with your computer, then restart the computer while holding the C key.
2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.
3. Click the First Aid tab.
4. Click the disclosure triangle to the left of the hard drive icon to display the names of your hard disk volumes and partitions.
5. Select your Mac OS X volume.
6. Click Repair. Disk Utility checks and repairs the disk."
http://docs.info.apple.com/article.html?artnum=106214
Then Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it finishes.
If you still have the same problem...
Quit Mail.
Then in your Home folder. open Library folder, open Caches folder in that, look for the Mail, and drag it to the Desktop.Move Envelope Index to the Desktop in...
/Users/YourUserName/Library/Mail/Envelope Index
Move this folder to the Desktop...
/Users/YourUserName/Library/Caches/Mail -
Mail freezes when attaching PDF from Acrobate
I have a new issue with mail, when I am in Acrobat and attempt to Attach to email, Mail sometimes gives me an error (don't have it exactly, sorry) and then I get the spinning wheel and have to force quit. Does this mean corrupt preferences?
Mail sometimes gives me an error (don't have it exactly, sorry)
The exact text of the error message could very well be the key to unraveling this mystery.
Does this mean corrupt preferences?
No, we can't assume anything at this point without more information. How big are these PDF files; what version of Mail are you running? Have you checked Software Update to see if you need the Mail Update released yesterday? If not, do that first.
You should also replicate this problem and write down the exact text of the error message and include it in your reply along with the other information. In addition, see if you can replicate this problem in a new user account; if you can, then the issue is system-wide.
Mulder -
Mail freezes when I want to add an attachment with my mail.
Since I installed OS 10.9 mail freezes when I want to add an attachment with my mail. How can this be resolved?
My iMac is from mid 2007 with 4 GB internal memory and 1 TB of diskspace of which 45% is used.Go to Settings>Store, tap the ID shown, sign out, sign back in with the ID you want to use.
-
Mountain Lion Mail freezing?
Anyone having this trouble? Archives on Mail freezing goes back to 2005. Has it resurfaced? This annoying thing just started tonight, when I was trying to attach a small eps file, or just now, simply clicking on Reply to a message. Anyone else dealing with this?
Very frustrating indeed. While just trying to view an email containing an eps attached, Mail completely freezes upon selecting that message. I even deleted the message on the server, but it is still showing up in the thread in Mail. Sorry, no further insight here...
-
Mail freeze's and then restarts
Hey guys,
once i receive a new email and i go to reply to it Mail, freeze's goes to an error screen and relaunch's Mail, but whenever i got to an older email i am able to send the message through. Any ideas?Unrelated to why it is not gathering the email into the Inbox, let me address about POP. For POP access, Gmail assembles a subset of the new messages in the Inbox for presentation to the first email client that signs to download. After that, Gmail remembers that one computer has already accessed the message, and does present it for any second computer and email client to download, even though the messages remain on the server. That is why it can said to not be true POP3, and there are things to get corrupted in the process.
With the change, you must sign onto your Gmail account via your browser, and then click on Settings. Once on that page, click to enable IMAP in under Status in the section for IMAP access. Sorry to not mention this earlier, but I was rushing out the door for some errands.
Did you delete the Outbox.mbox folder, btw?
Ernie
Message was edited by: Ernie Stamper -
Mac Mail freezes every time we receive an EPS file
Our Mac Mail freezes every time we receive an EPS file. We are running 10.7.3.
I wonder if your Mac is attempting to open the file directly.
I usuall zip my attachments before emailing them. This prevents any odd behavior on any computer and also precludes corruption during the email routing. Yes, this is only a workaround, but you might wait to see if others have a similar issue.
You can also run Console and read the log to see if there is any information about what is stalling the process. -
Attachments to mail are corrupted
I cannot attach items to mail using the attachement button.
I can drag items into mail and the are attached, but are corrupted.Not certain, but this can fix myriad Mail problems...
Safe Boot from the HD, (holding Shift key down at bootup), it will try to repair your Disk Directory while the spinning radian is happening, so let it go, run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, then move this folder & file to the Desktop.
Move this Folder to the Desktop...
/Users/YourUserName/Library/Caches/Mail/
Move this file to the Desktop...
/Users/YourUserName/Library/Mail/Envelope Index
Reboot.
If that doesn't do it and you can afford to redo all your Rules, try these & reboot...
/Users/YourUserName/Library/Mail/MessageRules.plist
/Users/YourUserName/Library/Mail/MessageRules.plist.backup
Note, in 10.5 & up /Users/YourUserName/Library/Caches/Mail/ may or may not exist. -
Mail freezes when I send to a certain address
I have one particular email address for a colleague that whenever I send him an email, mail freezes and I get the spinning ball. I have to force quit and relaunch mail at which time mail sends the message.
I have repaired permissions, am completely up date on 10.6.6, deleted and recreated the address card for the colleague but I suspect the problem may be the auto fill address in mail might be using some older corrupt version of the address to send the message.
Any thoughts on how I can correct this without resorting to the workaround, force quitting and relaunching mail eveytime I send this person an email?Launch the Console application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad and start typing the name.
The title of the Console window should be All Messages. If it isn't, select
SYSTEM LOG QUERIES ▹ All Messages
from the log list on the left. If you don't see that list, select
View ▹ Show Log List
from the menu bar at the top of the screen.
Click the Clear Display icon in the toolbar. Then take an action that isn't working the way you expect. Select any lines that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
Please don't indiscriminately dump thousands of lines from the log into this discussion.
Please don't post screenshots of log messages—post the text.
Some private information, such as your name or email address, may appear in the log. Anonymize before posting. -
Problem with Mail 7.1 attachment link click
This is with OSX 10.9.1 Maverick and Mail 7.1; when clicking a link in an attachment Mail freezes and the famous "ball" starts circling; will stop in about 10 minutes and Mail still frozen. Restart Mail, restart OSX, disc utility, etc. etc., has not helped. HELP
waldemar.hersacher wrote:
Dear Ali,
it seems that you have installed Vision driver components but not any Vision products. If do not plan to use Vision products goto the Control Panel>>Add/Remove programs and use "National Instruments Software" to remove all Motion & Vision entries in the setup.
When starting MAX will be loaded and searches for all components. For some reason it searches for the IMAG configuration manager.
Thank you for your response. However, I could not find any trace of Motion or Vision components. Therefore I uninstalled LabVIEW and installed everything again. Now, things are working perfectly. But I do not know why. We had installed Motion and Vision on this machine previously but they were uninstalled before the installation of LabVIEW 7.1. However, before installing the LabVIEW, we did not restart the PC. Could it be this which was the problem? -
Mail freezes when I even open it. I have read for hours the various reports of this problem but none of the solutions or descriptions seems to fit me or help.
The problem began just yesterday, but it would freeze when I would begin deleting messages, even though I could get past the opening. I was able to delete one or two, then it would freeze and I would have to do a force quit. Now, after quitting and opening a half dozen times, it freezes even when I try to open.
I have downloaded the latest Mail updates/software
I have allowed mail to rebuild the Envelope Index file
I have repaired permissions on the HD
I have rebuilt each of the In Box mailboxes
I have rebooted the computer without power attached, waited, attached power and rebooted.
I have seven POP accounts plus the .mac account
I can't figure out what else to do and this just started yesterday after a fairly flawless experience with Mail of late. Please help! I am paralyzed in keeping up with e-mails.I went to the Apple Store and the Genius Bar expert downloaded a recent "fix" for Mail that is not part of the software upgrades. You can get it by searching Mail for Mail Update downloads. He had to also import my mail boxes and preference list files after installing the update. It mostly seems okay now but I am not sure as I have just begun to use it again and it does not feel as stable as before. Just last night I notice a very strange thing. Any mail from amazon.com that I try to open or delete instantly freezes the program again and I have to force quit. I found one other reference to this on the discussion boards, but no explanation. I was able to manually drag the amazon.com e-mail to the trash and get rid of it but this morning another appeared, and also caused freezing. The amazon.com mail was not my initial problem, though it might have been part of it, since deleting anything would freeze things before, and finally I could not even launch mail without it freezing. That is now fixed, but there are still strange things going on here.
-
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.
Maybe you are looking for
-
I cannot send any messages from my iPad. The send button is not lit up. My setting are on. When I put the address in it comes up in red with an exclamation mark
-
How do I know which version of Firefox is installed on my laptop
How ca I tell which version of Firefox is installed on my laptop.
-
Despite checking 'save and quit' before exit, I lose all tabs upon re-launch.
This kind of thing keeps me from making Firefox my default browser. This never happens with Chrome.
-
Xcode Continuous integration - latestRunSubStatus = internal-credential-server-error
Greetings. I have been trying to make continuous integration build using Bots with Xcode 5.1(5B130a) from Xcode server (3.1.1). The SCM is configured with external svn repository, which am able to successfully browse from safari. Am trying to make in
-
A1 error "process.gapps"
I seem to be getting an error of, "com.google.process.gapps" every day now. It started a few days ago and has gotten worse as time goes by. Often I will get it 2 or 3 times in a row, mostly when moving from one screen to another. I get the option to