Total Pageviews

Wednesday, December 13, 2017

Excel function for Rail Fence Cipher and Caesar Cipher

      Rail Fence Cipher:

·     
           Key and String as argument parameter from user,
o   =encode(input string, key)
o   =decode(encoded string, key)
·         If the user enters 2 then
o   There will be 2 rows:
o   fn encode_P1 ("MESSAGE IS THIS",2) will modify the input as:
MSAEI HSESG STI
M
S
A
E
I
H
S
E
S
G
S
T
I



o   fn decode_P1 ("MSAEI HSESG STI",2) will print the output as:

MESSAGE IS THIS

·         If the user enters 3 then
o   There will be 3 rows:
o   fn encode_P1 ("MESSAGE IS THIS",3) will modify the input as:
MAIHESG STISE S

M



A



I



H



E

S

G



S

T

I



S



E







S

o   fn decode_P1 ("MSAEI HSESG STI",3) will print the output as:
MESSAGE IS THIS

Caesar Cipher:

Eg. MESSAGE IS NOT THIS.
·       fn encode_P2("MESSAGE IS NOT THIS",3) will offset it by 3 ASCII characters.
Output:  PHVVDJH#LV#QRW#WKLV
fn decode_P2("PHVVDJH#LV#QRW#WKLV",3) will return the original statement.
Output: MESSAGE IS NOT THIS


Please put your thoughts and comments below so that I can improve.

THANKS EVERYONE.

SUBHAJIT.


Tuesday, August 15, 2017

Sending Automated emails from Excel via YahooMail


Hello Everyone,

I have written other blogs on sending mail from Excel using VBA via Outlook and Gmail.

This blog contains the code for sending mails from Excel using VBA via YahooMail.
This is tested from a personal free yahoo account.
Here is the code for the same:


Sub automated_email_yahooMail()
    
    Dim mail As CDO.Message
    Set mail = New CDO.Message

    With mail.Configuration.Fields
   
       '1. Setting SSL Authentication
       .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
       '2. Setting SMTP Authentication
       .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
       '3. Setting SMTP Server and Port
       .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.yahoo.com"
       .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
       
       
       .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        
       'USERID AND PASSWORD
       .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "emailID@yahoo.com"
       .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
        
       'Don't forget to Update the configuration fields
       .Update
    End With
    
    With mail
       .To = "emailID1@domain.com"
       .From = "emailID@yahoo.com"
       .Sender = "Warlock Solutions"
       .CC = "emailID2@domain.com"
       .BCC = "emailID3@domain.com"
       .Subject = "Test mail from VBA via YahooMail"
       .textbody = "Please respond if you've received."
       .AddAttachment "Path\attachmentName.attachmentExtension"
       .Send
    End With
    
    Set mail = Nothing
End Sub


Please put your thoughts and comments below so that I can improve.

THANKS EVERYONE.

SUBHAJIT.

Wednesday, August 2, 2017

Sending Automated emails from Excel via GMAIL

Hello Everyone,


This blog contains details regarding sending automated emails from excel.
The other blog that I wrote on similar line is used to send mail via yahooMail.

This blog contains the code for sending MAILS VIA GMAIL.
This is tested from an corporate google account.
Here is the code for the same :

Sub automated_email_gmail()
   
    Dim mail As CDO.Message
    Set mail = New CDO.Message

    With mail.Configuration.Fields
  
       '1. Setting SSL Authentication
       .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
       '2. Setting SMTP Authentication
       .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
       '3. Setting SMTP Server and Port
       .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
       .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
      
      
       .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
       
       'Credentials of your Gmail Account
       'https://myaccount.google.com/
       'https://myaccount.google.com/security
       'Go to App Passwords
       'Select "Mail" in Select App
       'Select "Windows Computer" in Select device
       'Click Generate
       'Copy the password generated and paste it in the password field
      
       'USERID AND PASSWORD
       .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "emailID@domain.com"
       .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "Case Sensitive Password"
       
       'Don't forget to Update the configuration fields
       .Update
    End With

    With mail
       .To = "emailID1@domain.com"
       .From = "emailID@domain.com"
       .Sender = "Warlock Solutions"
       .CC = "emailID2@domain.com"
       .BCC = "emailID3@domain.com"
       .Subject = "Test mail via gmail"
       .textbody = "Please respond if you've received."
       .AddAttachment "Path\attachmentName.attachmentExtension"
       .Send
    End With

    Set mail = Nothing
End Sub

Please put your thoughts and comments below so that I can improve.

THANKS EVERYONE.

SUBHAJIT.