19 lines
844 B
Plaintext
19 lines
844 B
Plaintext
Sub SendEmail(fromAddress As String, toAddress As String, ccAddress As String, _
|
|
subject As String, messageText As String, serverName As String, loginDetails As String)
|
|
Dim As String comando
|
|
comando = "echo '" & messageText & "' | mailx -s '" & subject & "' -r '" _
|
|
& fromAddress & "' -S smtp='" & serverName _
|
|
& "' -S smtp-auth=login -S smtp-auth-user='" & loginDetails _
|
|
& "' -S smtp-auth-password='yourpassword' -c '" & ccAddress & "' '" _
|
|
& toAddress & "'"
|
|
Shell comando
|
|
End Sub
|
|
|
|
Dim As String fromAddress = "your_mail@gmail.com"
|
|
Dim As String toAddress = "recipient@gmail.com"
|
|
Dim As String ccAddress = "cc@gmail.com"
|
|
Dim As String subject = "Mail subject"
|
|
Dim As String messageText = "This is the body of the email."
|
|
Dim As String serverName = "smtp.gmail.com"
|
|
Dim As String loginDetails = "your_username"
|