Changing smtp settings and account selection in Mail

I've just begun tinkering with Applescript... but not for fun! I'm not a programmer but I understand some VERY basic things about scripting.
I need a way to set the smtp USER NAME for a specific account in Mail to a different user name. (I would select the user name from a dialog and I figured out that part.) None of the other settings will change. Is there a way to do this? Of course there must be -- I was able to set the user name for the incoming mail server but I can't for the life of me figure out how to do this for the outgoing!
Also, I would like Applescript to change the account that the frontmost message will be sent from. I don't want it to be the default account in this instance. Is that possible? I haven't been able to even come close to figuring that out.
One last thing: How do you concatenate a string in AppleScript? For example (where aVariable = "01"):
"johnsmith_" & aVariable & "@mydomain.com"
result I want: "[email protected]"
I was able to figure out how to assign a value to "aVariable" but I couldn't tell if I was using the correct method for stringing everything together. The line generated an error but I couldn't tell where I messed up.
It's been interesting and promising but also very frustrating so any help would be appreciated.
Vera
G5 Dual 2.5 (1.5GB ram); G4 Dual 450 (704MB ram)   Mac OS X (10.4.9)  

> Outgoing servers are different - despite the smtp server appearing to be part of the 'Account' settings, they're not. There's a separate class for smtp server'.
In this case, to set the username used to authenticate against your SMTP server you'd do soemthing like:
set user name of smtp server "my.company.net" to "johndoe"
If I have multiple email accounts all accessing the same smtp server but with different user names, how does it know which one to change? I tried something like this...
<pre class=command>set user name of smtp server "my.company.net" of account "Account #3" to "[email protected]"</pre>
(BTW: My smtp server uses complete email addresses in the username field so I changed it just to make it clearer for myself)
But I get this error:
<pre>Mail got an error: NSReceiverEvaluationScriptError: 4</pre>
> > Also, I would like Applescript to change the account that the frontmost message will be sent from
Hmm, I can't see this off-hand, either. I'll keep digging.
It would be nice if there was something. Optionally, I might be able to work changing the DEFAULT account to another account into my "workflow" instead. Is that any easier to find?
> You have it right. The & is used to concatenate strings. ... I'm not sure why it would generate a message, unless 'aVariable' wasn't what you thought. What did the error message say?
Unfortunately I don't remember anymore -- I was getting so many errors, it's all a blur now... and I already deleted the code. There was probably something else wrong in the line. I've tried concatenating elsewhere since then and it worked fine but I didn't think to try that before asking.
Thanks for the help!
Vera
G5 Dual 2.5 (1.5GB ram); G4 Dual 450 (704MB ram)   Mac OS X (10.4.9)  

Similar Messages

  • Mac Mail Issue: I was having trouble sending to hotmail accounts from my Earthlink account, they had me go into Mac Mail preferences and make changes, now Mac Mail doesn't work AT ALL - any help changing the settings back to correct Mac Mail settings? I c

    I was having trouble sending to hotmail accounts from my Earthlink account, they had me go into Mac Mail preferences and make changes (because they claimed it was Mac Mail's fault, even though the hotmail error code said it's because Earthlink is blocked by hotmail), now Mac Mail doesn't work AT ALL - any help changing the settings back to correct Mac Mail settings? I can provide a transcript of the entire tech chat session, if that will help...

    both apostrophes are used correctly, thanks
    doesn't = does not (this is called a contraction)
    it's = it is
    Mac Mail's fault = possessive
    any help with the actual issue? thanks!

  • HT4157 I have a cellular data account on my iPad. Almost immediately after I signed up, my e-mail was hacked and had to be cancelled. I cannot get into my AT&T cellular data account now to change the billing and account to my new e-mail. Please help.

    I have a cellular data account on my iPad. Almost immediately after I signed up, my e-mail was hacked and had to be cancelled. I cannot get into my AT&amp;T cellular data account now to change the billing and account to my new e-mail. Please help.

    According to the AT&T Wireless web site, you can manage your iPad data plan either from the iPad, or by using a web browser:
    From the website
    Log in to your account at att.com/iPadlanding using the email address and password you used during activation.
    Your account information will display. Select the desired account change option then tap Next.
    Read the Terms of Service, and then tap Accept.
    Review the Payment Summary to ensure the details are correct. Use the Back button if changes are required, otherwise tap Submit.
    Read the Confirmation message then tap OK.

  • I set iCloud up last week and the next day when out in the field I could not get Outlook to open up.  I want to change my settings so I can get mail at home or in the field

    I set iCloud up last week and the next day when out in the field I could not get Outlook to open up.  I want to change my settings so I can get mail at home or in the field, not just when i'm at home.  I have a PC and fios internet with Verizon at home.  I have a Sprint air card in the field or access an available wifi.  I want to change my settings to allow for receiving email in the field.  What's the point of an air card and icloud for backup fi it doesn't work in the field for some odd reason?

    Apple - Support - Mail Setup Assistant

  • Since the 4.0.1 update the first Firefox window I open refuses to open tabs, only new windows, and all refuse to show my bookmarks toolbar. All Sync settings and account seem lost.

    Since the update the first Firefox window I open refuses to open tabs, only new windows, and all refuse to show my bookmarks toolbar. All Sync settings and account seem lost.

    G'day again, I've also lost the option of a 'Stop loading' or 'Refresh' button.

  • When I download Microsoft word documents (if have word 2007), I have somehow changed the settings and it downloads them in wordpad, and the format is very bad and I can't read a lot of the document. How do I change the default setting back to using Micro

    When I download Microsoft word documents (if have word 2007), I have somehow changed the settings and it downloads them in wordpad, and the format is very bad and I can't read a lot of the document. How do I change the default setting back to using Microsoft Word 2007 to open these documents?
    == This happened ==
    Every time Firefox opened
    == about a few weeks ago - I had tried to open some docuuments saved on a mac, my PC (which runs Windows 7), used word pad to open these, and this seems to have changed the default settings somehow.

    See this:
    [http://support.mozilla.com/en-US/kb/Managing+file+types]

  • How can i change the scroll direction of the trackpad? Someone hooked a mouse up to it and it changed the settings and I cant change it back.

    How can i change the scroll direction of the trackpad? Someone hooked a mouse up to it and it changed the settings and I cant change it back.

    >System Preferences>Hardware>Mouse>Point & Click>Scroll Direction.

  • Icloud was originally set up wrong and I cannot get in to change my settings and no longer know the password

    icloud was originally set up wrong and I cannot get in to change my settings and no longer know the password

    Go to http://appleid.apple.com and click 'Forgot password'. Enter the ID you set iCloud up with. A new password will be sent to your associated email address.

  • The "read" emails in one of my 3 email accounts have disappeared. I changed no settings and checked the view and they are gone. I need them back! Help!

    Suddenly my main email account is not showing the emails I've kept in line...the other accounts haven't changed at all. I changed no settings, checked everything, no tags are in place. I shut down the program and opened it and nothing. I need those messages back! Where could they be??? Thank you in advance for any help you can give me!

    There are several possible reasons that messages seem to 'disappear'.
    There are two types of email accounts: IMAP and POP. See https://support.mozilla.org/en-US/kb/glossary-terms-including-types-accounts
    If you have a POP account and are accessing the mail on more than one computer or smartphone, whichever device reads (downloads) the message first will have it locally, but it will no longer be listed or available on the other devices.
    If you have an IMAP account, the message stays on the server, but if one device (user) moves or deletes the message, it will affect the view on all devices. So, for example, if you are using your smartphone and take some action on an email, when you get back to your computer, it will reflect that same action (but you might not have realized what caused it).
    Sometimes the index of a mail folder (.msf) will get corrupted. If you right click on the name of the folder and select Properties, a 'Folder Properties' window will open. Select 'Repair Folder'. This may take care of the problem.
    Another, less likely, reason for messages not to show up in your inbox is having the preference set to show only unread or recent messages. Then once you read them they seem to disappear.
    If you are still having problems, please look at the following items and respond with the information.
    1) What operating system do you use (Win8, MAC, Linux, etc)?
    2) Are you using IMAP or POP?
    3) If your mail server has a browser interface (web mail access such as mail.google.com), do the messages show up there?
    4) Right click on the folder in question and select Properties.
    a) Number of messages?
    b) Size on disk?
    5) Left click on the account name; View settings for this account; highlight Server settings;
    What choices are marked under "When I delete a message"?
    6) What, if any, antivirus program do you have installed?

  • Change dock settings and mouse actions in accounts?

    After creating accounts for my class periods I changed the appearance of my/the administrator's dock and the actions of my mighty mouse to enable right click. After logging out and then logging back in as one of my class periods my changes did not carry through.
    Please tell me there is an easier way to change the dock and mouse actions than having to log back in as the administrator, going to EACH account, changing them so they can access system preferences, log back in as the class period, make the changes and finally go back in as the admin to take off their access to system preferences. Yuck...
    Also, when a student is logged into their period is there a way to switch to the admin account temporairily? For example, if they try to open an application they don't have privileges for shouldn't it prompt the admin to type in the password instead of requiring that I log out? Thanks for any help!

    Download and install the Server Admin Tools from Apple. It is intended for OS X Server but works fine on the regular version of Tiger.
    Then have a look at Workgroup Manager. It allows you to set all sorts of preferences for any number of accounts. Think of it like Parental Controls on steroids.

  • Can't reset SMTP settings on account preferences - inactive/gray

    I hope you can help.
    It looks like Mail was updated (great in theory, bad in practice), and now I can't send from Mail. I get the error message : "SMTP settings are not sete, please use Accounts Preferences panle to set SMTP options.
    So, I dig out my incoming server, pop.mail.yahoo.com and my ourtiong mail SMTP server info: smtp.mail.yahoo.com
    But when I go to Preferences/Accounts, it won't let me make any changes. All the fields are gray and inactive, except for "E-mail aliases" which I tried and nothing happened.
    Help! All advice is greatly appreciated!
    Amy

    Amy,
    First of all, I don't know what you mean by "Mail has updated"-- please explain? if you mean Mail has suddenly opened as though new, then you may have an issue with available free space on your hard drive, or if partitioned, on the boot partition. Check free space if this is what happened.
    As for the grayed out entry info, it appears you proceeded into setting up the account in the Preferences with the Account Type set to .mac, which of course, is not what you would use for a Yahoo account.
    More info, please.
    Ernie

  • Change smtp settings

    I can't change my iCloud smtp settings for some reason. It's all greyed out.  I can't send email through iCloud either. I have checked ny iCloud account and it's verified, but when I try to send email it comes up with "can't send email, check settings at mail contact calendars? Very strange as its been working ally day

    It appears that at least 1 server was not working for awhile.  Seems to be working now.
    See this.

  • I have an annoying message that pops up saying that I have an unauthorised attempt to change the settings, and asks if I want to keep the current settings or accept the changes.

    Even if I was computer literate enough to know the difference, it does not tell me what the changes are, or more iomportantly, where they have come from. I always answer, Yes, I am happy with my current settings, and ignore the No, please make the changes, but this message box keeps on presenting every time I open Firefox. I have tried right-clicking on different places on the message box, to try and find a way of removing it.. Can anyone tell me how I might remove this messgae?

    Check that you do not run Firefox as Administrator.
    Right-click the Firefox desktop shortcut and choose "Properties".
    Make sure that all items are deselected in the "Compatibility" tab of the Properties window.
    * Privilege Level: "Run this program as Administrator" should not be selected
    * "Run this program in compatibility mode for:" should not be selected
    Also check the Properties of the firefox.exe program in the Firefox program folder (C:\Program Files\Mozilla Firefox\).

  • I have a new mac pro.  i may have changed the settings and now when i log on it shuts off after 10 seconds. not long enough to check settings.

    i am new to mac book pro.  i was checking out the settings and must have changed something as now when i log on, it shuts down within 10 seconds and i don't have time to get into the settings. the top tool bar is red/pink.  please help!

    Close all windows and quit all applications.
    Hold the option key down and click the "Go" menu in the Finder menubar.
    Select "Library" from the dropdown, then "Preferences" folder.
    Look for these two files.
    com.apple.desktop.plist
    com.apple.systempreferences.plist
    Right click each  one of those and select " Move To Trash" from the contextual menu.
    Restart the computer.

  • How do I get rid of the dropdown list history on the location bar? I have tried changing several settings and all I have done is mess up my ability to open ZIP downloads.

    I wanted to clear the drop down suggestions/history list on the location bar so I went to Tools/Options and tried changing several settings. I could not get the results I wanted. Suggestions?
    I did get one unwanted result -- or maybe just a coincidence. I received an email with attached pictures in a ZIP format and I could not get the download to open. Suggestions?

    Tools > Options > Privacy > Location Bar: When using the location bar, suggest: Nothing
    See [[Smart Location Bar]]

Maybe you are looking for

  • LO Error

    Hi Gurus,    Am trying to fill setup table in LO-cockpit and    getting the error "no Extraction structure active or    no BW connected", after reading the forums the    solution for the error is to run the patch or note    914268. But how do i run t

  • When I open itunes on my laptop, how do i stop itunes from automatically prompting for my apple account info?

    When I open itunes on my laptop, and I have connected my iPod Touch, how do I stop itunes from automatically prompting for my apple account info?  I'm usually not intending to make any purchases at that time, so do they need to know my account info?

  • Help me sync. macbook osx 10.4.11, iphone ios 4.2.1, itunes 9.2.1(5)

    A while back I had an issue with updating my iphone 3G on my mac, so I used a friend's mac and updated it to ios 4.2.1. Now it won't connect to my itunes 9.2.1(5) and I can't update my itunes unless I update my OSX and my computer won't allow me to u

  • Question from a college student.

    I am really interested in picking this up, but I just have a quick question. I live on campus at college, and I don't have a router so technically I don't have a network. I'm assuming how I'd hook up the apple tv is just by going directly from the et

  • Sensor RF Codatex

    He comprado varios sensores RF de Codatex, y ellos te ofrecen los Iconos para el software NXT pero no encuentro el icono de Labview en el toolkit 2.0 para labview 2009 en su paleta para usar este tipo de sensores. Gracias!!