automate E-mail - redemption

iknowu99

Well-known Member
Joined
Dec 26, 2004
Messages
1,158
The info i retrieved is from the following posts:

http://www.mrexcel.com/board2/viewtopic.php?t=281494
and
http://www.mrexcel.com/archive2/58500/67827.htm


When using redemption code the inbox receives it 10 minutes later. I have installed the redemption file and use Ivan's code:

Code:
Sub MAIN()
Call EMailViaRedemption("myEmail", "C:\testing.xls")
End Sub

Private Sub EMailViaRedemption(strRecipAddr As String, strFileFullPathName As String)

Dim SafeItem As Object
Dim oItem As Object
Dim App As Object
Dim MyAttachments As Object

On Error GoTo EndProperly
Set App = CreateObject("Outlook.Application")
'// Create an instance of Redemption.SafeMailItem
Set SafeItem = CreateObject("Redemption.SafeMailItem")
'// Create a new message
Set oItem = App.CreateItem(0)
'// Now create the SafeItems
With SafeItem
    .Item = oItem
    .Recipients.Add strRecipAddr
    .Recipients.ResolveAll
    Set MyAttachments = .Attachments
    MyAttachments.Add strFileFullPathName
    .Subject = Now
    .Send
End With
EndProperly:
Set SafeItem = Nothing
Set oItem = Nothing
Set App = Nothing
Set MyAttachments = Nothing
End Sub


now with

Code:
Sub MAIN()
EmailSingleSheetWithoutSaving
End Sub

Sub EmailSingleSheetWithoutSaving()
ActiveSheet.Copy
ActiveWorkbook.SendMail "MyEmail", Now
End Sub

It is instantaneous, yet it gives me this annoying message that prevents automation

A program is trying to automatically send e-mail on your behalf. Do you want to allow this?

If this is unexpected, it may be a virus and you should choose “No”

How to avoid this message and get immediate results?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

iknowu99

Well-known Member
Joined
Dec 26, 2004
Messages
1,158
i am trying to stay awy from using outside applications....i would rather send keys, currently i am working with the following and it is not working:

Code:
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%S"
 

iknowu99

Well-known Member
Joined
Dec 26, 2004
Messages
1,158
Currently the "Click Yes" software works but perhaps someone knows the VBA code for it?
 

iknowu99

Well-known Member
Joined
Dec 26, 2004
Messages
1,158
anyone know how to avoid the click yes part??
 

iknowu99

Well-known Member
Joined
Dec 26, 2004
Messages
1,158
Thanks, a good redirect.

i am trying to use the following, only not sure how to get the SMPT part and how to attach the active worksheet.

Code:
Sub Mail_Small_Text_CDO() 
    Dim iMsg As Object 
    Dim iConf As Object 
    Dim strbody As String 
    '    Dim Flds As Variant 
  
    Set iMsg = CreateObject("CDO.Message") 
    Set iConf = CreateObject("CDO.Configuration") 
  
        iConf.Load -1    ' CDO Source Defaults 
        Set Flds = iConf.Fields 
        With Flds 
            .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "111.111.111.111" 'Need your STMP address here 
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
            .Update 
        End With 
  
    strbody = "Hey There," & vbNewLine & vbNewLine & _ 
              "Test 1" & vbNewLine & _ 
              "Test 2" & vbNewLine & _ 
              "Test 3" & vbNewLine & _ 
              "Test 4" 
  
    With iMsg 
        Set .Configuration = iConf 
        .To = "Test@Test.com" 
        .CC = "" 
        .BCC = "" 
        .From = """TestUser"" <TestUser@test.com>" 
        .Subject = "Important message" 
        .TextBody = strbody 
        .Send 
    End With 
  
    Set iMsg = Nothing 
    Set iConf = Nothing 
End Sub
 

Forum statistics

Threads
1,181,658
Messages
5,931,268
Members
436,785
Latest member
KingGideon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top