2015-07-03 41 views
1

有人可以幫我解決這個問題。如何使用genexus evo 3發送電子郵件給網絡

我試圖使用一些數據類型,如SMTSession,MailMessage,MailRecipient。

但它不起作用。

這是代碼。

&SMTPSession.Host     = 'smtp.gmail.com'<br> 
    &SMTPSession.Port    = 465<br> 
    &SMTPSession.Authentication  = 1<br> 
    &SMTPSession.UserName   = '[email protected]'<br> 
    &SMTPSession.Password   = 'password'<br> 
    &SMTPSession.Secure    = 1 <br> 
    &SMTPSession.Sender.Address  = '[email protected]'<br> 
    &SMTPSession.Sender.Name  = 'OtherName'<br> 
    &MailRecipient.Address   = '[email protected]'<br> 
    &MailRecipient.Name    = 'Name'<br> 
    &MailMessage.Subject   = 'Subject'<br> 
    &MailMessage.Text    = 'text'<br> 
    &MailMessage.To.Add(&MailRecipient)<br> 


    &SMTPSession.Login() 
    if &SMTPSession.ErrCode <> 0 
     &SMTPSession.Send(&MailMessage) 
     &SMTPSession.Logout() 
    endif 

Genexus演進3升級2,.NET環境中,網絡

回答

0

嘗試用587端口。

您可以添加錯誤說明嗎?

在App Pool IIS中,您有enabled 32 bit application嗎?

+0

587是STARTTLS,以純文本形式啓動,然後切換到TLS,所以它應該有安全= 0(在啓動之前不強制使用TLS)。 – pmoleri

0

該代碼似乎很好。 與我所做的事,唯一的區別是,我寫&錯誤= & SMTPSession.Login()

的Gmail帳戶使用的是沒有兩步驗證啓用?

相關問題