[GB.NET.SMTP]
* BUG: Support multi-line greetings and mulit-line answer at authentication pass. git-svn-id: svn://localhost/gambas/trunk@6556 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
df0aea5171
commit
d20ad59bd7
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 3.4 KiB |
@ -2,11 +2,11 @@
|
||||
|
||||
Public Sub Main()
|
||||
|
||||
' Dim hClient As New SmtpClient
|
||||
'
|
||||
Dim hClient As New SmtpClient
|
||||
|
||||
' hClient.Host = "smtp.gmail.com"
|
||||
' hClient.Encrypt = Net.SSL
|
||||
' hClient.User = "g4mba5@gmail.com"
|
||||
' hClient.User = "benoit.minisini@gmail.com"
|
||||
' Print "Password:"
|
||||
' Line Input hClient.Password
|
||||
' hClient.Debug = True
|
||||
@ -16,28 +16,28 @@ Public Sub Main()
|
||||
' hClient.To.Add("Benoît Minisini <benoit.minisini@gmail.com>")
|
||||
' hClient.Body = "This is a test e-mail.\nI hope it will work...\n\nIl était une fois un tout petit bébé \n=====\nJOLI HISTOIRE.\n Il y a une pièce jointe !"
|
||||
' hClient.Add(File.Load("~/TexteDehorsilpleut.odt"), "application/vnd.oasis.opendocument.text", "Dehors il pleut.odt")
|
||||
' hClient.Add(File.Load("~/Zeno.png"), "image/png", "zeno.png")
|
||||
' hClient.Add(File.Load("~/balloon.png"), "image/png", "balloon.png")
|
||||
' hClient.Send
|
||||
|
||||
Dim hMsg As New SmtpClient
|
||||
|
||||
hMsg.Debug = True
|
||||
hMsg.To.Add("somebody@gmail.com")
|
||||
hMsg.Subject = "Test"
|
||||
hMsg.Add("Something" & "\n\n" & ("-- \nPowered by ") & Application.Name & "\n")
|
||||
hMsg.From = "somebody@gmail.com"
|
||||
hMsg.Host = "smtp.gmail.com"
|
||||
hMsg.Port = 465
|
||||
'hMsg.User = "unknown@gmail.com"
|
||||
'hMsg.Password = "donotknow"
|
||||
'hMsg.Encrypt = Net.SSL
|
||||
|
||||
Try hMsg.Send()
|
||||
If Not Error Then
|
||||
Print "Send successfully"
|
||||
Else
|
||||
Print "Send Failed: "; Error.Text
|
||||
Endif
|
||||
' Dim hMsg As New SmtpClient
|
||||
'
|
||||
' hMsg.Debug = True
|
||||
' hMsg.To.Add("somebody@gmail.com")
|
||||
' hMsg.Subject = "Test"
|
||||
' hMsg.Add("Something" & "\n\n" & ("-- \nPowered by ") & Application.Name & "\n")
|
||||
' hMsg.From = "somebody@gmail.com"
|
||||
' hMsg.Host = "smtp.gmail.com"
|
||||
' hMsg.Port = 465
|
||||
' 'hMsg.User = "unknown@gmail.com"
|
||||
' 'hMsg.Password = "donotknow"
|
||||
' 'hMsg.Encrypt = Net.SSL
|
||||
'
|
||||
' Try hMsg.Send()
|
||||
' If Not Error Then
|
||||
' Print "Send successfully"
|
||||
' Else
|
||||
' Print "Send Failed: "; Error.Text
|
||||
' Endif
|
||||
|
||||
|
||||
End
|
||||
|
@ -289,7 +289,7 @@ Private Sub Connect()
|
||||
|
||||
If $iEncrypt <> Net.TLS Then
|
||||
' greetings
|
||||
$hSession.GetLine()
|
||||
$hSession.GetLine(True)
|
||||
Endif
|
||||
|
||||
sData = $hSession.Send("EHLO " & GetDomainName(), True)
|
||||
@ -310,7 +310,7 @@ Private Sub Authenticate()
|
||||
sData = $hSession.Send("AUTH PLAIN")
|
||||
If $hSession.LastCode <> "334" Then Error.Raise("Unsupported authentication method")
|
||||
|
||||
sData = $hSession.Send(Base64$($sUser & Chr$(0) & $sUser & Chr$(0) & $sPassword))
|
||||
sData = $hSession.Send(Base64$($sUser & Chr$(0) & $sUser & Chr$(0) & $sPassword), True)
|
||||
If $hSession.LastCode <> "235" Then Error.Raise("Authentication failed")
|
||||
|
||||
Catch
|
||||
|
Loading…
x
Reference in New Issue
Block a user