Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Setting gmail credentials
- % Please use your own gmail(Google mail) credentials
- % And write your messages
- senderEmail = 'pentest09@wp.pl'
- senderPassword = 'Prezentacja11.12'
- recipientEmails = {'gethsemanens@gmail.com', 'maciej2356@gmail.com'}
- headerMessage = 'Hello World in MATLAB'
- bodyMessage = 'disp() is used to write message on console.'
- % Specify encoding for email
- encoding = 'UTF-8'
- % Specify SMTP server (It is fixed for Google mail)
- emailServer = 'smtp.wp.pl'
- % By default, the `sendmail` function does not support email servers that require authentication.
- % To support these servers, change your system settings and set preferences for the
- % SMTP user name and password, with commands in the following form:
- props = java.lang.System.getProperties;
- props.setProperty('mail.smtp.auth','true');
- props.setProperty('mail.smtp.port', '587');
- props.setProperty('mail.smtp.starttls.enable','true');
- setpref('Internet','SMTP_Server', emailServer);
- setpref('Internet','SMTP_Username', senderEmail);
- setpref('Internet','SMTP_Password', senderPassword);
- setpref('Internet','E_mail_Charset', encoding);
- setpref('Internet','E_mail', senderEmail)
- sendmail(recipientEmails, headerMessage, bodyMessage);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement