problem sending emails with outlook

jerry12302

Active Member
Joined
Apr 18, 2005
Messages
456
Office Version
  1. 2010
Platform
  1. Windows
:banghead:
Every month I have to send emails to various clients with files attached, a different file for each client. I wanted to automate the task. I found some vba code on the web to use, requiring the use of outlook. I configured outlook to receive and send emails using my AOL account. It was working fine, able to send and receive manually from outlook. I then tried the code, and at first, it worked fine.

Now it is not working, and worse, I can't even send emails manually through outlook anymore.

Sub MailerTest()
Dim objol As New Outlook.Application
Dim objmail As MailItem
Set objol = New Outlook.Application
Set objmail = objol.createitem(olmailitem)
With objmail
.To = "someemailaddress@yahoo.com"
.cc = "ccsomeemailaddress@hotmail.com"
.Subject = "Test 12/9 10:39"
.Body = "This is a Test 12/9 10:39"
.NoAging = True
.Attachments.Add "C:\somefile.xls"
.display
End With
Set objmail = Nothing
Set objol = Nothing
SendKeys "%{s}", True
End Sub

The code above was the original attempt, which worked, then I added a loop to go through the list of email addresses and appropriate file attachments. It worked at first, then I started getting errors in Outlook, now it won't work, and even this original code doesn't work.

Here are the errors I get in Outlook:

Your message did not reach some or all of the intended recipients.

Subject: Test 12/9 10:39
Sent: 12/9/2005 10:41 AM

The following recipient(s) could not be reached:

'someemailaddress@yahoo.com' on 12/9/2005 10:41 AM
554 TRANSACTION FAILED

'ccsomeemailaddress@hotmail.com' on 12/9/2005 10:41 AM
554 TRANSACTION FAILED

(of course, the actual email addresses have been changed for illustrative purposes here)

Any suggestions would be greatly appreciated.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hello,

This is an Outlook issue, not an Excel issue. Check your server settings and reconfigure if necessary. It would be best if you had your IT people look at it (if any).

Since this is an Outlook issue, I moved it to the appropriate forum.
 
Upvote 0
We have no IT people here. I did check the server configuration, and it is correct, according to aol instructions.

I posted this in Excel in case the code itself may have had anything to do with the problem.
 
Upvote 0
No, the code looks fine. I wouldn't use SendKeys, but that's me. I'd check out Outlook Redemption if I were you, or use Display and press Send yourself (which is what I do).

Have you tried an Outlook Detect & Repair? I've not used an AOL account with Outlook as I don't use AOL, so I'm not sure on your server settings.
 
Upvote 0
Zack,

I just tried the Outlook detect and repair, and now I seem to be able to send emails manually, at least my tests did not come back right away as undeliverable. I haven't received replies back, but I think they went through OK.

I have never heard of Outlook Redemption, is that a separate software you purchase that you use instead of Outlook, or is that used in conjunction with your Outlook software?

Thanks for your help.
 
Upvote 0
Upvote 0
Zack,

The emails are getting through now, manually and with my macro, after using the detect and repair feature. (and I stopped using .display and .sendkeys, I replaced .display with .send)

The only complaint is the annoying message outlook displays for every email message saying "a program is trying to send email automatically..." etc., and you have to press OK to let it go through.

I wish I could prevent that message from popping up, but I did find a program called "click yes". It clicks the yes button for you automatically. I still see the messages, but I don't have to sit there and click Yes for each email. They disappear as the emails are sent.

I googled Outlook Redemption and downloaded it, but haven't tried it yet. I couldn't find any information on whether I would still get those warning messages or not.

Thanks for your help.
 
Upvote 0
To supress that message you are seeing, you must use Outlook Redemption.
 
Upvote 0

Forum statistics

Threads
1,224,856
Messages
6,181,427
Members
453,040
Latest member
Santero

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
Back
Top