Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 130
Default Email Macro only sometime works?

Range("T4").Select
ActiveCell.FormulaR1C1 = "1"

Do Until cont = 44

cont = Range("T4").Value
dothing = Range("N15").Value

If dothing 0 Then

mail = Range("W4").Value
rang = Range("AK2").Value

Dim iMsg As Object
Dim iConf As Object
Dim sh As Worksheet
Dim rng As Range
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") = "******"

..Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

Set sh = Sheets("Mail")
Set rng = sh.Range(rang)

With iMsg
Set .Configuration = iConf
.To = mail
.CC = ""
.BCC = ""
.From = """Paul"" <*******"
.Subject = "Your Current Closures"
.HTMLBody = RangetoHTML(sh, rng)
.Send
End With

Set iMsg = Nothing
Set iConf = Nothing


Else
End If

Windows("Daily Advisor Stats.xls").Activate
Sheets("Calc").Select

Range("T6").Select
Selection.Copy
Range("T4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False

Loop


This is sends data from the "Mail" sheet, based on what number is in T4,
each number is for a different person. In this way it should send to each
individual information on their own figures.

When I change the email address from W4, to W3 (and in W3 I have the email
address of the bloke sat across from me) it sends fine. But when its on W4,
where the email address of the individual will be updated it doesn't send,
don't even get an error.

Will this just not work on External email, only Internal? Or do I need to
use a different smtpserver? Even when I put my address in the BCC I don't get
sent it...

Also, when they go through internally, they are centre adjusted in the
email, rather than left adjusted....
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro works but buttons don't markvi Excel Discussion (Misc queries) 0 June 8th 06 09:19 PM
Excel macro works only for administrator Free Agent99 Excel Discussion (Misc queries) 12 May 15th 06 09:25 PM
Need a macro to Copy a selection and paste into a new email. Koolmist Excel Discussion (Misc queries) 3 February 20th 06 04:48 PM
Email Macro using IMAP account billy2willy Excel Discussion (Misc queries) 0 August 17th 05 05:59 PM
Email Macro with Outlook Express Moe Excel Discussion (Misc queries) 2 August 10th 05 02:50 PM


All times are GMT +1. The time now is 01:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"