Re: 32 bit SSL SMTP
Posted: Wed Mar 02, 2016 7:35 am
it have attach creation function for letters?
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
; process to test new email capabilities in PB 5.40
EnableExplicit
;****************************************************************************************
; send out the page to the secure server
;****************************************************************************************
Procedure SendPage()
Protected result.i
Protected logText.s
Protected mailNumber.i
Protected emailType.s = "text/plain"
Protected mailHost.s = "smtp.gmail.com"
Protected userName.s = "user.name@gmail.com"
Protected mailFrom.s = "user.name@gmail.com"
Protected mailPort.i = 587
Protected mailTo.s = "someone_else@some_email.com"
Protected subject.s = "64 bit email Test using TLS Encryption"
Protected emailBody.s = "Dear Sir, this email is brought to you courtesy of 64 bit TLS Encryption."
PrintN("Enter the password for " + userName)
Protected password.s = Input()
PrintN("SendPage() > About to create mail!")
mailNumber = CreateMail(#PB_Any, userName, subject)
If mailNumber > 0
AddMailRecipient(mailNumber, mailTo, #PB_Mail_To)
SetMailBody(mailNumber, emailBody)
result = AddMailAttachmentData(mailNumber, "attachment", @emailBody, Len(emailBody), emailBody)
PrintN("SendPage() > AddMailAttachmentData return value: " + Str(result))
result = SendMail(mailNumber, mailHost, mailPort, #PB_Mail_UseSSL, userName, password)
PrintN("SendPage() > SendMail return value: " + Str(result))
FreeMail(mailNumber)
Else
PrintN("SendPage() > error creating mail process")
EndIf
EndProcedure
; open the console window, initialize the network, send the message, then quit
InitNetwork()
OpenConsole()
SendPage()
Input()
CloseConsole()