|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique . g* O; J, s9 m3 s0 P+ X1 r
Use the CCO.Email object to send email messages.
" y4 u# P) W/ C6 ~) |2 qC# ( F* a M2 u: @, D: c/ o. m9 N4 r/ h
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
& i% L7 M9 r' xemail.From = fromEmail; $ J3 s% U$ F$ x# W
email.To = toEmail; 3 F5 k3 d0 Z/ p/ \- p1 a
email.Subject = subject;
! r$ y+ v7 F! u+ X- m# e" S3 N1 memail.Body = body; + }- e# U8 H ~3 k$ h4 ~
CCO.Email.setup_smtpmail_server_and_send(email); 9 k0 V3 P$ f& Z# b. E8 q+ U9 [
: V5 s7 S( k- C9 c$ \" ^5 O4 l// Alternatively use the SendEmailToIdentity : \& r' v Q+ o* ~. E/ |% t
// The first argument is the Identity name to send the email message.
; a) S+ M2 |! O+ ~// The second argument is the subject text. 9 ~4 b, C1 |/ _+ D3 p% W
// The third argument is the email body text. % N2 S; u$ `& f! d& G [
// The last argument is a user login name as the sender and " E( z8 ^+ u! e: a+ U! K
// if blank will use the logged in user name and
% B% M6 C& Y k0 d3 T c- S2 y// that User Item must have an email address as well.
8 j9 i2 a O( t# FCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 6 w J; L' Z4 _" G
return this.newInnovator().newResult("ok"); $ c5 g$ f, P' Q
VB.Net 5 Y0 P0 N, Q4 a# G5 k2 _$ g5 e$ T
Dim email = New System.Web.Mail.MailMessage() % ~2 I' Y$ u; Y7 E, \# U8 `, }7 |
email.From = fromEmail / q6 @( j7 j( D4 ^: g
email.To = toEmail 4 O6 U' e) X# h( p
email.Subject = subject
! \) t6 q7 k" N( _. t9 q$ B$ Jemail.Body = body # D" A5 I% ^: H3 V6 D) O
CCO.Email.setup_smtpmail_server_and_send(email)
( b+ w0 `% x' Q1 h / @. Y. ?3 Y/ L: r2 j* u2 Y
' Alternatively use the SendEmailToIdentity 2 Y: d3 I3 i, u Y
' The first argument Is the Identity name To send the email message. ) H" J% M0 d0 ~# y( T ^* b$ z( D' @
' The second argument Is the subject text. : ]3 R% Q# T \* F5 Q
' The third argument Is the email body text.
% V" d5 X" q0 g# \9 T2 z' The last argument Is a user login name As the sender And
' D* ^1 ]: [9 V# R+ [! ?; Y' If blank will use the logged In user name And 1 ~# |3 I$ c2 v4 n( Y
' that User Item must have an email address As well. , m0 ^4 l0 \$ r/ j' W. W
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
$ K' i, z/ ^3 j0 a$ `3 V7 P' D: K4 `9 ~9 |; j0 _* a
|
|