Advertisement
Guest User

Untitled

a guest
Jan 15th, 2019
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.21 KB | None | 0 0
  1. % Setting gmail credentials
  2. % Please use your own gmail(Google mail) credentials
  3. % And write your messages
  4. senderEmail = 'pentest09@wp.pl'
  5. senderPassword = 'Prezentacja11.12'
  6. recipientEmails = {'gethsemanens@gmail.com', 'maciej2356@gmail.com'}
  7. headerMessage = 'Hello World in MATLAB'
  8. bodyMessage = 'disp() is used to write message on console.'
  9.  
  10. % Specify encoding for email
  11. encoding = 'UTF-8'
  12.  
  13. % Specify SMTP server (It is fixed for Google mail)
  14. emailServer = 'smtp.wp.pl'
  15.  
  16. % By default, the `sendmail` function does not support email servers that require authentication.
  17. % To support these servers, change your system settings and set preferences for the
  18. % SMTP user name and password, with commands in the following form:
  19. props = java.lang.System.getProperties;
  20. props.setProperty('mail.smtp.auth','true');
  21. props.setProperty('mail.smtp.port', '587');
  22. props.setProperty('mail.smtp.starttls.enable','true');
  23.  
  24. setpref('Internet','SMTP_Server', emailServer);
  25. setpref('Internet','SMTP_Username', senderEmail);
  26. setpref('Internet','SMTP_Password', senderPassword);
  27. setpref('Internet','E_mail_Charset', encoding);
  28. setpref('Internet','E_mail', senderEmail)
  29.  
  30. sendmail(recipientEmails, headerMessage, bodyMessage);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement