ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Send emails through VBA but skip outlook "Yes" button (https://www.excelbanter.com/excel-programming/371563-send-emails-through-vba-but-skip-outlook-yes-button.html)

[email protected]

Send emails through VBA but skip outlook "Yes" button
 
Hi All,

I am using the following code to send emails from VBA. However, where I
do so, an outlook box opens up saying "A program is trying to
automatically send email on your behalf. Do you want to allow this?"

After this unless the user clicks on "Yes" button the email is not
sent.

ActiveWorkbook.EnvelopeVisible = True
Worksheets("Template").Activate
With ActiveSheet.MailEnvelope
.Item.To = "
.Item.Cc = emailadd
.Item.Subject = "Appraisal Form for " & TextBox5.Value
.Item.Send
End With

Is there a way to skip this step as I need to code a macro which
identifies deviations in a continous loop and sends emails as and when
it finds some deviations.

Thanks in advance,
Yash


Varadharajan

Send emails through VBA but skip outlook "Yes" button
 
Hi

Give a try with Application.SendKeys method in ur Code.

U will be able to send various key combinations to the application ur
initiation

for complete details check the HELP on sendkeys method.

thanks
Varadhan


wrote:

Hi All,

I am using the following code to send emails from VBA. However, where I
do so, an outlook box opens up saying "A program is trying to
automatically send email on your behalf. Do you want to allow this?"

After this unless the user clicks on "Yes" button the email is not
sent.

ActiveWorkbook.EnvelopeVisible = True
Worksheets("Template").Activate
With ActiveSheet.MailEnvelope
.Item.To = "
.Item.Cc = emailadd
.Item.Subject = "Appraisal Form for " & TextBox5.Value
.Item.Send
End With

Is there a way to skip this step as I need to code a macro which
identifies deviations in a continous loop and sends emails as and when
it finds some deviations.

Thanks in advance,
Yash



[email protected]

Send emails through VBA but skip outlook "Yes" button
 
Hi Varadharajan,

Thanks for the suggestion. However, my code will have to check various
conditions every minute and sendkeys may not the best option for this.

Please let me know if there are other options too.

Thanks,
yash
Varadharajan wrote:
Hi

Give a try with Application.SendKeys method in ur Code.

U will be able to send various key combinations to the application ur
initiation

for complete details check the HELP on sendkeys method.

thanks
Varadhan


wrote:

Hi All,

I am using the following code to send emails from VBA. However, where I
do so, an outlook box opens up saying "A program is trying to
automatically send email on your behalf. Do you want to allow this?"

After this unless the user clicks on "Yes" button the email is not
sent.

ActiveWorkbook.EnvelopeVisible = True
Worksheets("Template").Activate
With ActiveSheet.MailEnvelope
.Item.To = "
.Item.Cc = emailadd
.Item.Subject = "Appraisal Form for " & TextBox5.Value
.Item.Send
End With

Is there a way to skip this step as I need to code a macro which
identifies deviations in a continous loop and sends emails as and when
it finds some deviations.

Thanks in advance,
Yash



Sriram

Send emails through VBA but skip outlook "Yes" button
 
Yash,

Please tell me are you going to send the file as soon as it reaches some
sort of values. You'va mentioned some sort of deviations occur in the loop
then it should get automaticallt mailed.

Please tell me what sort of deviations you want to verify, whether those are
in code or in some cells of an excel sheet?

Please tell me, so that I can proceed further in giving you a solution.

If you wish, you can send a sample mail to me on the below mail id.


Regards,
Sriram

" wrote:

Hi Varadharajan,

Thanks for the suggestion. However, my code will have to check various
conditions every minute and sendkeys may not the best option for this.

Please let me know if there are other options too.

Thanks,
yash
Varadharajan wrote:
Hi

Give a try with Application.SendKeys method in ur Code.

U will be able to send various key combinations to the application ur
initiation

for complete details check the HELP on sendkeys method.

thanks
Varadhan


wrote:

Hi All,

I am using the following code to send emails from VBA. However, where I
do so, an outlook box opens up saying "A program is trying to
automatically send email on your behalf. Do you want to allow this?"

After this unless the user clicks on "Yes" button the email is not
sent.

ActiveWorkbook.EnvelopeVisible = True
Worksheets("Template").Activate
With ActiveSheet.MailEnvelope
.Item.To = "
.Item.Cc = emailadd
.Item.Subject = "Appraisal Form for " & TextBox5.Value
.Item.Send
End With

Is there a way to skip this step as I need to code a macro which
identifies deviations in a continous loop and sends emails as and when
it finds some deviations.

Thanks in advance,
Yash




Ron de Bruin

Send emails through VBA but skip outlook "Yes" button
 
See
http://www.rondebruin.nl/mail/prevent.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



wrote in message oups.com...
Hi All,

I am using the following code to send emails from VBA. However, where I
do so, an outlook box opens up saying "A program is trying to
automatically send email on your behalf. Do you want to allow this?"

After this unless the user clicks on "Yes" button the email is not
sent.

ActiveWorkbook.EnvelopeVisible = True
Worksheets("Template").Activate
With ActiveSheet.MailEnvelope
.Item.To = "
.Item.Cc = emailadd
.Item.Subject = "Appraisal Form for " & TextBox5.Value
.Item.Send
End With

Is there a way to skip this step as I need to code a macro which
identifies deviations in a continous loop and sends emails as and when
it finds some deviations.

Thanks in advance,
Yash





All times are GMT +1. The time now is 06:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com