PLM之家PLMHome-工业软件践行者

Teamcenter二次开发源码分享:创建信封发送邮件

[复制链接]

2020-2-8 09:32:14 2946 0

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x

& z  w. K) Y* J/ m4 rTeamcenter二次开发源码分享:创建信封发送邮件/ G) J- `1 z; X' r" P1 {
% S# U' g! [) m4 G# t, e
[mw_shl_code=cpp,true]#include <iostream>; ?3 f& G( |! Z/ l8 ^4 w
#include <sa/user.h>
- Q: Z& O$ m9 T7 T, d$ Q. ?#include <TC/envelope.h>1 @: m( F5 X3 z& [& a, N# q
#include <tc/tc.h>: t# M9 |. F7 ?2 t

) u8 i# ~7 D$ H5 U#include <base_utils/IFail.hxx>7 @: v' ~) c, O8 u9 C
#include <base_utils/TcResultStatus.hxx>
' [  g$ H, ^, X2 M0 M) _& s#include <mld/logging/TcMainLogger.hxx>
' t4 i! D; }) b$ N#include <base_utils/ScopedSmPtr.hxx>5 m8 N* n7 h9 k1 Y( G" A( _
. t8 V7 M2 w5 |4 u+ f7 H6 \  w
using namespace std;8 R6 v( R" U: W* ~1 i0 J
using namespace Teamcenter;- y. S7 I( }, A5 q* J$ {5 g4 C
using Teamcenter::Main::logger;
, x, s0 ]- ]% A/ l* ?( v: H  l5 c; b6 f) ~( Q
static void create_envelope_and_send_mail(void)- m$ D3 E( C0 k1 j5 V
{
+ P, D% b- ^: W; U    int ifail = ITK_ok;3 r: o: _' U2 U2 a4 ]5 ]2 n9 _, B
    ResultStatus stat;
# E* k  H- U# U9 K0 \    try
  |5 I4 ^* c  c& _/ d4 e) |    {   
) A. D1 {# h! g# y4 E/ _        scoped_smptr<char> user_name_string;1 {" |- d/ }' u5 y/ G3 M: H
        tag_t user_tag = NULLTAG;- `! P4 Y0 T4 ]) l; a% w) w
        stat = POM_get_user(&user_name_string, &user_tag);
' M; V3 u! Z( R1 N
5 B9 x" q0 F, |  L: r8 S        tag_t envelope = NULLTAG;
, Y; Z9 G& y- F8 w# S        stat = MAIL_create_envelope("1234567/A", "1234567/A", &envelope);
/ h. h. R+ f" s9 _        - Q3 E: v# f5 f9 a3 }) b6 q
        stat = MAIL_initialize_envelope(envelope,"1234567/A", "1234567/A");1 N! `; ?& {# ]  O+ G; U6 U+ F, J7 C
        stat = MAIL_add_envelope_receiver(envelope, user_tag);4 F5 J& t; s6 m8 K
        stat = MAIL_send_envelope(envelope);) Q, D  J# ~) r9 V! M
% q. R* G3 w+ ~" I7 U
        tag_t mailbox = NULLTAG;2 ~' n0 N* t9 g; X
        stat = SA_ask_user_mailbox(user_tag, &mailbox);
* G0 Z% y" y. |    }
$ S. R  {4 U  _; e; n( q" L( ?    catch( const IFail &ex )
6 ~+ @' |3 f$ y+ M! C% R0 Y  Z    {8 b* L5 T( \- g* m4 Y$ L
        logger()->error( ex.ifail(), ex.getMessage());+ f; y& _* g0 B4 R7 O9 n
        cout << ex.getMessage()  << endl;
. q0 }1 q  \: S( H        cout << "error " << ex.ifail() << endl;        
: d- X) c; ?2 e4 l7 |: O' A    }& y- E& V, ~  ?. a; q) ]
}[/mw_shl_code]
: s/ E, u9 \  [) V5 y
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了