Send outlook email if textfile contains except some value

Hi Team,

Could you please help to send email if textfile contains except “Column1”
Am reading text from excel and copying in to text file,with output(textfile) checking the condition if textfile contains except “Column1”.
Facing issue in writing the if condition as below:

1 Like

@RajeshT

You can use Contains method.

  verify.Tostring.Contains("Column1")
  Then nothing
   Else send mail
1 Like

Thank you @lakshman,

Its working for me,how can we copy the verify values in body of email?

1 Like

@RajeshT

Do you mean you want to copy particular matching word or entire body of the mail ?

1 Like

Hi @lakshman ,

I am trying write mail content in Send outlook email and printing the output values from text file as below but getting error:

@RajeshT

It should be in single line but you are writing it in multiple lines.

1 Like

Hi @lakshman ,
If we write in single line how can i break the line and sending email in structured format?
Hi Team,

Good Morning!

PMacs Agent_APT_Details_UNS file has been validated,We encountered a Problem in below mentioned Policeies:"

AG021327-- EL34-Sale Branch is Mandatory
AG021602-- EL34-Sale Branch is Mandatory
AG021863-- EL34-Sale Branch is Mandatory
AG022070-- EL34-Sale Branch is Mandatory
AG022263-- EL34-Sale Branch is Mandatory

Regards,
Team

I want to be in above format

@RajeshT

It should be like this.

  "Hi Team,"+Environment.NewLine+Environment.NewLine+"Good Morning"+Environment.NewLine+Environment.NewLine+"PMacs......."

Note: If you face any issues then please create one more post and post your issues and as this post closed right. And also these are not relevant to post.

1 Like

Sure noted and this code of line is perfect!!
Thanks a ton!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.