Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

how to import a list of email addresss from a CSV file?

Discussion in 'E-mail Discussion' started by SoftDux, Nov 13, 2007.

  1. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    994
    Likes Received:
    2
    Trophy Points:
    168
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Hi all

    I'd like to know if it's possible to import a list of email addresses & passwords, that I have in a .csv file
     
  2. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    316
    Location:
    San Clemente, Ca
    /scripts/addpop <email> <pass>

    I think that still works, i have not tested it so give it a try first... if it works it should be very easy for you to take a CSV file and loop it into that script.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. RandyO

    RandyO Well-Known Member

    Joined:
    Jun 17, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    166
    so how would you do it? "very easy" please post the script if you would

    thanks
     
  4. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    318
    Without seeing your CSV, it would be impossible to tell the format of your file. If it's

    Name, Email, password

    this may work (replace /root/mycsv.csv with the location of your CSV file. You may need to change the cut lines based on the format of your file as well.):

    ##Note: no warranty of any kind is provided with this script. It is provided for informational purposes only. Use the code at your own risk###


    Code:
    #!/bin/sh
    
    while read inputline
    do
            email="$(echo $inputline | cut -d, -f2)"
            pass="$(echo $inputline | cut -d, -f3)"
            /scripts/addpop $email $pass
    done < /root/mycsv.csv
    
    exit 0
     
    #4 DaveUsedToWorkHere, Nov 26, 2007
    Last edited: Nov 26, 2007
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice