如何发送Excel中图表到邮件,0中发送邮件

问题:怎么发送Excel中图纸到邮件?

电子邮件的使用相当广泛,例如在某网站注册了二个账户,自动发送一封欢迎邮件,通过邮件找回密码,自动批量发送活动信息等。但那些使用不容许和我们协调经常发邮件一样,先打开浏览器,登录邮箱,成立邮件再发送。本文将不难介绍怎样通过
Java 代码来成立电子邮件,并连续邮件服务器发送邮件。

图片 1图片 2

[源码下载]如何发送Excel中图表到邮件,0中发送邮件。

回答:

1. 电子邮件协议

 1 DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
 2       docdata LIKE sodocchgi1,
 3       objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
 4       objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
 5       reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE,
 6       objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
 7 
 8 DATA: tab_lines TYPE i.
 9 
10 *----------------------------------------------------------------------*
11 
12 START-OF-SELECTION.
13   docdata-obj_descr = '发到邮件自动OBJ_DESCR'.
14   docdata-obj_name = 'OBJ_NAME'.
15   docdata-obj_langu = sy-langu.
16 
17   objtxt = '标题OBJTXT.'.
18   APPEND objtxt.
19 
20   objtxt = docdata-obj_descr.
21   APPEND objtxt.
22 
23   objtxt = '测试.'.
24   APPEND objtxt.
25 
26 * Write Packing List (Main)
27 * 3 has been fixed because OBJTXT has fix three lines
28   READ TABLE objtxt INDEX 3.
29 
30   docdata-doc_size = ( 3 - 1 ) * 255 + strlen( objtxt ).
31   CLEAR objpack-transf_bin.
32   objpack-head_start = 1.
33   objpack-head_num = 0.
34   objpack-body_start = 1.
35   objpack-body_num = 3.
36   objpack-doc_type = 'RAW'.
37   APPEND objpack.
38 
39   reclist-receiver = '***'."如果是发到工作台就填登陆用户名,如果是发到email就添email地址
40   reclist-receiver = 'tfhzy'.
41   TRANSLATE reclist-receiver TO UPPER CASE.
42   reclist-rec_type = 'B'."发到工作台
43 *RECLIST-REC_TYPE = 'U'."发到外部信箱
44   APPEND reclist.
45 
46   CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
47     EXPORTING
48       document_data                    = docdata
49 *   PUT_IN_OUTBOX                    = ' '
50       commit_work                      = 'X'
51 * IMPORTING
52 *   SENT_TO_ALL                      =
53 *   NEW_OBJECT_ID                    =
54     TABLES
55       packing_list                     = objpack
56 *    OBJECT_HEADER                    = OBJHEAD
57 *   CONTENTS_BIN                     =
58       contents_txt                     = objtxt
59 *   CONTENTS_HEX                     =
60 *   OBJECT_PARA                      =
61 *   OBJECT_PARB                      =
62       receivers                        = reclist
63    EXCEPTIONS
64      too_many_receivers               = 1
65      document_not_sent                = 2
66      document_type_not_exist          = 3
67      operation_no_authorization       = 4
68      parameter_error                  = 5
69      x_error                          = 6
70      enqueue_error                    = 7
71      OTHERS                           = 8
72             .
73   IF sy-subrc <> 0.
74 * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
75 *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
76   ENDIF.

在asp.net 2.0中发送邮件

一 、表格文件作为邮件附件发送;

电子邮件的在网络中传输和网页一样必要遵守特定的情商,常用的电子邮件协议包含SMTP,POP3,IMAP。个中国集中国人民邮政总局集团件的创办和发送只供给用到
SMTP协议,所以本文也只会涉嫌到SMTP协议。SMTP 是 Simple Mail Transfer
Protocol 的简称,即简单邮件传输协议。

View Code

作者:webabcd

② 、表格转为PDF,再作为邮件附属类小部件发送;

2. JavaMail

不知为何,一向重回非常报错,sy-subrc = 6,猜度是权力的标题。

① 、在web.config中的<configuration>内投入如下配置新闻(host—smtp服务地点;port—端口号;userName—用户名;password—密码。请自行修改)。